Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode12.4 Can't merge user_target_xcconfig for pod targets

I have been trying to update Pods, however, I get this warning every time I run pod update.

enter image description here

Here are the Excluded Architectures of the Project and Pods respectively.

enter image description here

enter image description here

What I've tried

  • Added this snippet to the top of Podfile
post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end
  • Removed Podfile.lock and Pods directory and run pod install

  • Almost followed this except for adding this snippet since I do not have .podspec file.

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

It would be great if you have advice and tips.

Thanks.

[Update] February 23, 2021 (PST)

I have not figured out this, can anyone help me to solve it, please?

Things I did additionally

  • Added this snippet to the top 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
  • Tried to remove VALID_ARCHS from the Target, however, it's not removable. Also, replace them with blank. Nothing changes.

Curious

This is a screenshot of the build settings of Pods. enter image description here Build Active Architecture Only for Release is currently set No. Even if I change this to Yes, it's overwritten. Is this fine with leaving it as No?

like image 711
Bob Avatar asked Feb 19 '21 07:02

Bob


Video Answer


1 Answers

In the short term, working around it in your podspec can work. Try this:

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

See source for more info.

Longer term, start asking those library maintainers to stop relying on user_target_xcconfig.

I maintain GoogleMobileAdsMediationFacebook and we learned this the hard way. The version 6.3.0.0 spec has been updated to set VALID_ARCHS at the pod_target_xcconfig level only. We plan to make the same changse to Google-Mobile-Ads-SDK in an upcoming release. But those other ads SDKs will need to do the same.

like image 121
Eric Leichtenschlag Avatar answered Nov 15 '22 09:11

Eric Leichtenschlag