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

问题描述 投票:0回答:2

我一直在尝试更新 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
  • 删除Podfile.lock和Pods目录并运行

    pod install

  • 几乎遵循this,除了添加此代码片段,因为我没有

    .podspec
    文件。

s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

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

谢谢。

[更新] 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
  • 尝试从目标中删除
    VALID_ARCHS
    ,但是,它无法删除。另外,将它们替换为空白。一切都没有改变。

好奇

这是 Pod 的构建设置的屏幕截图。

Build Active Architecture Only
Release
当前设置为
No
。即使我将其更改为
Yes
,它也会被覆盖。保留为
No
可以吗?

swift xcode sdk admob cocoapods
2个回答
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

请参阅来源了解更多信息。

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

user_target_xcconfig

我坚持

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


0
投票

我也有同样的问题。你找到解决方案了吗

© www.soinside.com 2019 - 2024. All rights reserved.