问题描述
我几天来一直在为这个问题苦苦挣扎:(在模拟器中构建我的 iOS 应用程序时它工作正常(调试构建),但是一旦我尝试构建到我的 iPhone 11 (v 14.5. 1) 我的构建失败并出现以下错误:
ld: warning: Could not find or use auto-linked framework 'GoogleDataTransport'
ld: warning: Could not find or use auto-linked framework 'FirebaseRemoteConfig'
ld: warning: Could not find or use auto-linked framework 'FirebaseCore'
ld: warning: Could not find or use auto-linked framework 'Protobuf'
ld: warning: Could not find or use auto-linked framework 'FirebaseInstallations'
ld: warning: Could not find or use auto-linked framework 'GoogletoolBoxForMac'
Undefined symbols for architecture arm64:
我使用的是 Xcode 12.5。我尝试了各种建议,例如:
- 将
LD_VERIFY_BITCODE
添加到user-defined
中的Build Settings
NO
的值
-
Enable Bitcode
在Build Settings
中,值为NO
- 删除派生数据
- 卸载和安装 Pod
- 干净的构建
- 确保
Framework Search Paths
看起来正确。我只有$(inherited)
- 将
$(inherited)
更改为recursive
- 确保我打开了 .xcworkspace 文件而不是 .xcodeproj
还有其他可能的解决方案吗?
解决方法
您应该尝试为所有目标(包括您的应用目标和多个 PODS 目标)设置 ENABLE_BITCODE = NO
。
这是您可以在 Podfile 末尾添加的内容。
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["ENABLE_BITCODE"] = "NO"
end
end
end
保存并执行pod install
。
做一个干净的构建,看看它是否有帮助。
如果我将 Flipper
中的 use_flipper!()
注释掉,该问题与 Podfile
相关。不幸的是,我还没有想出一种仅在本地设备上运行时禁用鳍状肢的好方法。