After updating to Xcode 5.1, I can no longer build my project for the 64-bit simulator, receiving this error:
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
These are my target build settings:
I tried changing "Build Active Architecture" to No, as well as adding "i386" to the "Valid Architectures", unfortunately neither worked. Thanks for any suggestions!
What you need to do is just set the ONLY_ACTIVE_ARCH
to NO
(at least works for me). Below is a screenshot for it:
As far as I know (please point it out if there's something wrong, thanks), if you set ONLY_ACTIVE_ARCH
to YES
, it means the Xcode will only build for the active architecture (which refers to the device that's active in Xcode currently). Seems Xcode's default setting is set Debug to YES
, so it won't build binaries for other architectures when you only want to build for a special device that connected to your Mac.
The reason failed to build might be that, the project does not support the architecture of the device you connected. So the best solution is to add the right architecture for your device. Below is a list for architectures & the devices that support:
iPhone 6
, iPhone 5s
, iPad Air
, Retina iPad Mini
iPhone 5
, iPhone 5c
, iPad 4
iPhone 3GS
, iPhone 4
, iPhone 4S
, iPod 3G/4G/5G
, iPad
, iPad 2
, iPad 3
, iPad Mini
iPhone
, iPhone 3G
, iPod 1G/2G
So why "set the ONLY_ACTIVE_ARCH
to NO
" works? Because the device can still run the binary that built for all architectures you added (pass the build), but will lose some performance. This's just a quick solution, but not best.
Note: The more architectures you added, the bigger the binary will be generated. So it's good to choose right architectures for your project. ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With