美文网首页
Flutter问题记录:引入flutter组件后报错'***-S

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

作者: Superman168 | 来源:发表于2025-01-06 14:56 被阅读0次

原来是这样导入的:

#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

相关文章

网友评论

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

      本文链接:https://www.haomeiwen.com/subject/griryjtx.html