29

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.

Pentagura
  • 551
  • 2
  • 8
  • 25

8 Answers8

51

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

ShaoJen Chen
  • 690
  • 6
  • 10
  • 1
    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 Sep 25 '20 at 07:32
  • I finally solved the problem. I do exactly what you do, but for "MyProjectTest" to and now, it work ! – Pentagura Sep 28 '20 at 12:09
  • @Gargantua i also have this issue. i tried the same but still i am not able to run my app on simulators. Please help – Akhil Oct 21 '20 at 10:49
  • As I say, I only add what @ShaoJen Chen tell and it work ! I had those lines on"MyProject3" and "MyProject3Tests" – Pentagura Oct 21 '20 at 11:55
  • 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 Dec 20 '20 at 04:40
  • 5
    I have this issue only on M1 MacbookAir, not on my iMac. – Umeumeume Dec 20 '20 at 05:12
  • @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. – Xavier Ojeda Aguilar Feb 06 '21 at 20:30
9

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.

Boken
  • 4,825
  • 10
  • 32
  • 42
7

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

Harsh
  • 109
  • 1
  • 3
  • 2
    How to run the app in rosetta – sejn Aug 26 '21 at 09:37
  • @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`. – CyberMew Jul 01 '22 at 10:54
5

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

enter image description here

koen
  • 5,383
  • 7
  • 50
  • 89
Ali Mehdi
  • 255
  • 5
  • 9
3

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

Tatarasanu Victor
  • 656
  • 1
  • 7
  • 19
1

For anybody coming across this in 2023:

Apple updated Xcode with 14.3 and moved the Rosetta settings to a per-project option:

https://sarunw.com/posts/open-using-rosetta-in-xcode-14-3/

-1

In Xcode 12, M1 chip macbook I just need to run the app in real device that's it

Kirtikumar A.
  • 4,140
  • 43
  • 43
-1

With Mac M1: Right click into xcode => Get Info => Open using Rosetta enter image description here enter image description here

Anhdevit
  • 1,926
  • 2
  • 16
  • 29