原来是这样导入的:
#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