No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=armv7 armv7s)

XcodeXcodebuild

Xcode Problem Overview


Running in Xcode is correctly, but when I want to use command line with $ /usr/bin/xcodebuild -scheme projectA -workspace projectA.xcworkspace -configuration Debug clean build

And come up with the following.

=== BUILD NATIVE TARGET projectA OF PROJECT projectA WITH CONFIGURATION Debug ===
Check dependencies
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=armv7 armv7s).

In Build Settings are:

  • Architectures: Starndard (armv7, armv7s)
  • Base SDK: Latest iOS (iOS 6.0)
  • Build Active Architecture Only: Debug Yes, Release No
  • Valid Architectures: armv7 armv7s

After I change Build Active Architecture Only = No, then the build was BUILD SUCCEEDED.

What is the suggestion setting for this situation, to build success under commend line mode? Thanks.

Xcode Solutions


Solution 1 - Xcode

You can set the "Build Active Architecture Only" and "Archs" values from command line itself. We set ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO.

>Eg > >/usr/bin/xcodebuild ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO -workspace -scheme ......

This will free you from manually changing the values in your project settings.

Solution 2 - Xcode

In my case it was empty cell in the 'valid architectures' on the target level which resulted in empty 'resolved' cell.

That lead to empty 'valid architectures' parameter and at the end linker error.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEdward ChiangView Question on Stackoverflow
Solution 1 - XcodeSertorio NoronhaView Answer on Stackoverflow
Solution 2 - XcodeBlazej SLEBODAView Answer on Stackoverflow