Carthage的framework不能在模拟器上工作
RT
ld: warning: ignoring file /Users/kimoji/project/NativeFlutterCordova/iOSNative/Carthage/Build/iOS/Cordova.framework/Cordova, building for iOS Simulator-x86_64 but attempting to link with file built for iOS-arm64
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CDVViewController", referenced from:
objc-class-ref in RootViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
根因:
问题出在模拟器库包含arm64,为了解决这个问题,则我们需要对carthage checkout下来的源工程进行修改,然后重新编译,使模拟器库中不再包含arm64。
解决:
需要修改第三方framework的编译设置
Project->Targets->Build Settings->Excluded Architectures
添加debug/release打包排除架构arm64