Xcode12.4 无法为 pod 目标合并 user_target_xcconfig

Bob*_*Bob 5 sdk xcode admob cocoapods swift

我一直在尝试更新 Pod,但是,每次运行pod update.

在此处输入图片说明

这里分别是项目和 Pod 的排除架构。

在此处输入图片说明

在此处输入图片说明

我试过的

  • 将此代码段添加到 Podfile 的顶部
post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end
Run Code Online (Sandbox Code Playgroud)
  • 删除 Podfile.lock 和 Pods 目录并运行 pod install

  • 除了添加此代码段之外,几乎都遵循了一点,因为我没有.podspec文件。

s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
Run Code Online (Sandbox Code Playgroud)

如果您有建议和提示,那就太好了。

谢谢。

[更新] 2021 年 2 月 23 日(太平洋标准时间)

这个我还没弄明白,有没有人能帮我解决一下?

我另外做的事情

  • 将此代码段添加到顶部 Podfile。
post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
    end
  end
end
Run Code Online (Sandbox Code Playgroud)
  • 试图VALID_ARCHS从目标中移除,但是,它是不可移除的。另外,将它们替换为空白。没有什么改变。

好奇的

这是 Pod 的构建设置的屏幕截图。 在此处输入图片说明 Build Active Architecture OnlyRelease当前设置No。即使我将其更改为Yes,它也会被覆盖。将其保留为可以No吗?

Eri*_*lag 4

从短期来看,在 podspec 中解决这个问题是可行的。尝试这个:

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "i386 arm64"
      end
    end
  end
end
Run Code Online (Sandbox Code Playgroud)

请参阅来源以获取更多信息。

从长远来看,开始要求那些库维护者停止依赖user_target_xcconfig.

我坚持认为GoogleMobileAdsMediationFacebook,我们是经过惨痛的教训才明白这一点的。版本6.3.0.0规范已更新为仅VALID_ARCHSpod_target_xcconfig级别设置。Google-Mobile-Ads-SDK我们计划在即将发布的版本中进行相同的更改。但其他广告 SDK 也需要执行相同的操作。