Flutter问题记录:引入flutter组件后报错'***-Swift.h' file not found

原来是这样导入的:

#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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容