Xcode 12 - No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=arm64e armv7s arm64 arm7)

24,826

Solution 1

If you can't see "VALID_ARCHS" in BuildSettings. You can click the plus button.

enter image description here

click "Add User-Defined Setting"

enter image description here

Input setting name "VALID_ARCHS" , input value "arm64 arm64e armv7 armv7s x86_64"

enter image description here enter image description here

Solution 2

Theorectically it should be enough changing debug from yes to no.

enter image description here

But as you said it did not work it must be that you have to set VALID_ARCHS to what you have plus x86_64.

Solution 3

M1 Mac: run Xcode in rosetta(by going to the .app file and clicking "get info" the click "open using rosetta"

Solution 4

Go to your App's target and select 64 bit standard architectures in Architectures section. See attached screenshot

enter image description here

Solution 5

run Xcode in rosetta(by going to the .app file and clicking "get info" the click "run under rosetta"

Share:
24,826
Pentagura
Author by

Pentagura

Updated on July 31, 2022

Comments

  • Pentagura
    Pentagura almost 2 years

    Since I update Xcode to Xcode 12, I've got this error when I build :

    Check dependencies
    No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=arm64e armv7s arm64 arm7)
    

    I try a lot of things :

    • Uninstall/reinstall Pods via pod install
    • Build Active Architecture Only to No or to Yes for Debug and Release
    • Same thing for Pods project

    Don't know what to do. This error come when I want to launch on iOS 14, but in iOS 13.7 this work perfectly without change.

    -- EDIT --

    I solve my problem by adding arm64 arm64e armv7 armv7s x86_64 to VALID_ARCHS, both in 'MyProject' and 'MyProjectTest', and it work now.

    • M Zubair Shamshad
      M Zubair Shamshad over 3 years
      try to run on actual device, this issue is on simulator
    • Pentagura
      Pentagura over 3 years
      @MZubairShamshad Ok I will test that, but how make it work on simulator ? I've not all Apple devices for real ^^
  • Pentagura
    Pentagura over 3 years
    I haven't this choice to select, what does I need to do to add this ?
  • Ali Mehdi
    Ali Mehdi over 3 years
    Add "$(ARCHS_STANDARD_64_BIT)" this in other option in Architectures
  • Ali Mehdi
    Ali Mehdi over 3 years
    Did you clean build?
  • Ali Mehdi
    Ali Mehdi over 3 years
    what was your previous value for architectures?
  • Pentagura
    Pentagura over 3 years
    Standard architectures - $(ARCHS_STANDARD)
  • Pentagura
    Pentagura over 3 years
    I also try to put Debug to "No", but I haven't "VALID_ARCHS" in XCode, I don't found it
  • Hola Soy Edu Feliz Navidad
    Hola Soy Edu Feliz Navidad over 3 years
    @Gargantua Pay attention on the top if it is showing all options or only the basic ones.
  • Pentagura
    Pentagura over 3 years
    It's the case, "All" is selected
  • Pentagura
    Pentagura over 3 years
    Thanks for your complete answer, but I doesn't work anymore... I precise it works since the beginning in a real device. The only problem is for emulator.
  • Pentagura
    Pentagura over 3 years
    I finally solved the problem. I do exactly what you do, but for "MyProjectTest" to and now, it work !
  • Akhil
    Akhil over 3 years
    @Gargantua i also have this issue. i tried the same but still i am not able to run my app on simulators. Please help
  • Pentagura
    Pentagura over 3 years
    As I say, I only add what @ShaoJen Chen tell and it work ! I had those lines on"MyProject3" and "MyProject3Tests"
  • Umeumeume
    Umeumeume over 3 years
    I added the VALID_ARCHS in all(project,target,AppTest), but no luck for iOS simulator. it worked only for the device. Any help?
  • Umeumeume
    Umeumeume over 3 years
    I have this issue only on M1 MacbookAir, not on my iMac.
  • Xavier Ojeda Aguilar
    Xavier Ojeda Aguilar over 3 years
    @NonUmemoto same for me in my M1. I have this issue because I'm trying to solve other problem, but int he thread they suggest to use Build legacy, and when I tried to use that, I get this.
  • sejn
    sejn over 2 years
    How to run the app in rosetta
  • Naresh
    Naresh over 2 years
    how to achieve it, can add some screen shots.
  • Naresh
    Naresh over 2 years
    I have followed your steps and added x86_64 in VALID_ARCHS but no use. How to resolve in Xcode 12.2....
  • CyberMew
    CyberMew almost 2 years
    @sejn You need to first have a M1 or M2 Mac to select that option as per the given answer. If you run Xcode in Rosetta, then the binaries will be running under 'Intel'. You can check by opening Activity Monitor, under the Kind column, see if it says Apple or Intel.