最近 Flutter SDK 升级到 2.5.1,xcode 执行构建时,很多包都报不支持,把所有的包升级到最新版后错误逐渐减少。最后构建时,只有 fluwx 报 “Undefined symbols for architecture arm64” 的错误。
报错信息大概如下:
ld: in ____PATH____/ios/Pods/WechatOpenSDK_Fuck/OpenSDK1.9.2/libWeChatSDK.a(WechatAuthSDK.o), building for iOS Simulator, but linking in object file built for iOS, file '____PATH____/ios/Pods/WechatOpenSDK_Fuck/OpenSDK1.9.2/libWeChatSDK.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
各方排查后,处理方式如下:
打开 ios 工程下的 Podfile 文件,修改 post_install do |installer|
部分的代码:
# 其余代码略
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
再次执行构建即可成功!
网友评论