Skip to content

Cocoapod add VALID_ARCHS but it's discouraged in Xcode 12 #10077

Closed

Description

@SmartHbdev

Hello,

From Xcode 12 release notes:

The Build Settings editor no longer includes the Valid Architectures build setting (VALID_ARCHS), and its use is discouraged. Instead, there is a new Excluded Architectures build setting (EXCLUDED_ARCHS). If a project includes VALID_ARCHS, the setting is displayed in the User-Defined section of the Build Settings editor. (15145028)

I have test to x86_64 for simulator only, test to exclude amd64 in both project and pod project... Sometimes it works but it depend on the project.
I have few prject, the only workaround that works 100% is to remove VALID_ARCHS line in the file located in the Pods/Targets Support Files/ Pods-(projectname)/Pods...xcconfig. Both in debug and release on the last line.

No need to exclude arm64 when there is no more VALID_ARCHS everywhere. It's very clean.

Is there a way to prevent pod update to not add this line or can cocoapod pubish a update to no more add this line in latest version of cocopod ?

Activity

  1. dnkoutso commented on Sep 21, 2020

    @dnkoutso
    Contributor

    Where does CocoaPods "add" VALID_ARCHS? Nothing in the code search shows it.

    I think this is a dup of CocoaPods/Xcodeproj#784

  2. SmartHbdev commented on Sep 21, 2020

    @SmartHbdev
    Author

    After you told me it wasn't Cocoapod I searched for installed pods and found it was in a lot of pods like Mopub, Applovin... I guess if it is in the xcconfig of one of them it is also put in the xcconfig of the general Pod.

    It is especially when the target is on IOS 9, from ios 10 it is no longer in it for Mopub, maybe it still is for others who have not fixed that.

    Can Cocoapod check this line and delete it automatically, maybe with a script to add in the Podfile?

  3. dnkoutso commented on Sep 21, 2020

    @dnkoutso
    Contributor

    We need to figure out how to support both for Xcode 11 transition and Xcode 12 with the new way. I still think the issue is in Xcodeproj.

    Use a post_install hook to delete VALID_ARCHS from the Pods.xcodeproj.

  4. SmartHbdev commented on Sep 21, 2020

    @SmartHbdev
    Author

    Yes a post_install but i don't know where i can find detailed docs.
    Maybe you can give me a sample to do that ?

  5. wxhzzsf commented on Sep 22, 2020

    @wxhzzsf

    add x86_64 in VALID_ARCHS

  6. SmartHbdev commented on Sep 24, 2020

    @SmartHbdev
    Author

    add x86_64 in VALID_ARCHS

    If you read my first post i say it's not a universal solution. post_install hook would be nice but i don't know how to write it

  7. dacaiguoguogmail commented on Sep 25, 2020

    @dacaiguoguogmail
    Contributor

    Fix all configuration

    target 'Demo' do
      post_install do |installer|
        installer.pods_project.build_configurations.each do |configuration|
          installer.pods_project.build_settings(configuration.name)['VALID_ARCHS'] = []
        end
      end
    end
    

    Fix one configuration, like Debug

    target 'Demo' do
      post_install do |installer|
        installer.pods_project.build_settings('Debug')['VALID_ARCHS'] = []
      end
    end
    
  8. dnkoutso commented on Sep 29, 2020

    @dnkoutso
    Contributor

    I am not seeing a thing we can do here for CocoaPods per se.

    If a podspec uses s.user_target_xcconfig then that this strongly discourages as the docs say and you have to delete it yourself via post_install hook.

    CocoaPods does not set VALID_ARCHS in your project, only uses it for read-only during lint which we have other issues filed for.

    I am going to close this for now. I will re-open if I have misunderstood something or new information shows we need to change something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions