Xcode 构建问题无法找到自动链接框架

Mic*_*ård 6 xcode build-settings ios swift xcode-build-settings

我已经为这个问题苦苦挣扎了好几天了:( 在模拟器中构建我的 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:
Run Code Online (Sandbox Code Playgroud)

我正在使用 Xcode 12.5。我尝试过各种建议,例如:

  • 添加LD_VERIFY_BITCODEUser-DefinedinBuild Settings的值NO
  • Enable BitcodeBuild SettingsNO
  • 删除派生数据
  • 卸载和安装 Pod
  • 干净的构建
  • 确保Framework Search Paths看起来正确。我只有 $(inherited)
  • 更改$(inherited)recursive
  • 确保我打开了 .xcworkspace 文件而不是 .xcodeproj

还有其他可能的解决方案吗?

Tar*_*agi 0

您应该尝试设置ENABLE_BITCODE = NO所有目标(包括您的应用程序目标和多个 PODS 目标)。

以下是您可以在 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
Run Code Online (Sandbox Code Playgroud)

保存并执行pod install. 进行干净的构建,看看是否有帮助。