Flutter问题记录:引入flutter组件后报错'***-S

2025-01-06  本文已影响0人  Superman168

原来是这样导入的:

#import "VideoCompressPlugin.h"
#import <video_compress/video_compress-Swift.h>

现在是这样的:

#import "VideoCompressPlugin.h"
#if __has_include(<video_compress/video_compress-Swift.h>)
#import <video_compress/video_compress-Swift.h>
#else
#import "VideoCompressPlugin.h"
#endif

主要是头文件,改了就可以编译通过了,不过改了不一定能解决问题。

@implementation VideoCompressPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
  [SwiftVideoCompressPlugin registerWithRegistrar:registrar];
}
@end

改为
@implementation VideoCompressPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
    [VideoCompressPlugin registerWithRegistrar:registrar];
}
@end
上一篇 下一篇

猜你喜欢

热点阅读