Xcode 4.4 - Unable to run project
Asked Answered
M

8

10

Having just upgraded Xcode 4.3 to Xcode 4.4, I get the following errors when running an existing project:

On the simulator: "Cannot run on the selected destination. The selected destination does not support the architecture for which the selected software is built. Switch to a destination that supports that architecture in order to run the selected software."

On the device: "Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device."

The funny this is, the project ran on Xcode 4.4 and the simulator for the first couple of runs and then stopped working. Have tried restarting but not reinstalling just yet, as Xcode is quite a big application and if it's just a settings problem then I don't really want to download it again from scratch.

Notes: Base SDK is Latest iOS (iOS 5.1), I'm on Lion (not Mountain Lion just yet) and my Deployment Target is iOS 4.0.

Monostrophe answered 26/7, 2012 at 16:4 Comment(6)
What is your base SDK set to? Are you on Lion Or Mountain Lion? These things could help.Mahound
Base SDK is Latest iOS (iOS 5.1) and I'm on Lion (not Mountain Lion just yet). My Deployment Target is iOS 4.0.Monostrophe
Architecture is not the same as SDK, check the architectures set, might be accidentally changed by you after several launches.Steverson
I had $(ARCHS_STANDARD_32_BIT) and armv6 set. Changing this to Standard (armv7) on it's own doesn't help either.Monostrophe
Also try doing a Clean first and then rebuild.Unanswerable
Unfortunately, that doesn't help either. I might try upgrading to Mountain Lion and/or using the Developer preview, see if either of those help the issue...Monostrophe
M
1

Upgrading to Mountain Lion fixed the issue. Not sure why, but it is now working on the simulator and on the device.

Monostrophe answered 27/7, 2012 at 14:10 Comment(0)
R
15

I had this problem and it turned out to be a spelling mistake in the product name in the build settings. Check all you product references are consistent in the settings and plists. Also check the product name does not contain a space or other "illegal" characters; this also causes the same error

Rhodic answered 31/7, 2012 at 12:44 Comment(5)
Thank you! My project name has Space character, removing space solves the problem.Leucopoiesis
I just set it to $(TARGET_NAME) and it fixed my problem.Cringle
This! After I done this I restarted Xcode and worked! Thank you.Cosecant
I had a '1' at the end of the name. I had no idea numbers counted as illegal characters. Thanks!!!!Alectryomancy
+1 It happened to me when I duplicated a build target and xcode decided to append "[space]copy" to it.Facer
T
5

I had this problem as well upgrading to 4.5 and my iPhone 4 to IOS 6

"Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device."

As I already ran on Mountain Lion, I did the following

1) set the valid architectures to the armv7s & armv7

2) doublechecked the spelling of the product name

3) reinstall to xcode 4.1.1

It worked for a while, but then I got the same error again. Then I got the tip (so obvious) to

4) delete the previously installed app (for debugging) on my device.

this worked! I will now never forget to delete the app as well on my device just to be sure it gets built with the latest settings.

Update: I have retried with xcode 4.5 / ios6 and above steps do work now as well. So I can now work with xcode 4.5 and ios 6.

Thermocline answered 2/10, 2012 at 4:52 Comment(0)
H
3

I upgrade Xcode from 4.3.2 to 4.5 this weekend and got the same issue.

in my case,

I fix it by changing project setting. Previously my project setting in Xcode 4.3.2 has an armv6 support in build - architecture. Since Xcode 4.5 drops this support, so I have to delete armv6 strings. That fix it, I can debug codes with iOS 6 device.

But when I submit the app, I have to go back to XCode 4.3.2. because marketing team in my company won't want to loose those possible minority users, in China, there are still few 4.1 and 4.2.1 existing.

so if your project ever support armv6, and encounter this unable to run project due to architecture in XCode 4.5, please have a try like me. hope can help.

Heft answered 23/9, 2012 at 2:29 Comment(0)
M
1

Upgrading to Mountain Lion fixed the issue. Not sure why, but it is now working on the simulator and on the device.

Monostrophe answered 27/7, 2012 at 14:10 Comment(0)
L
1

I experienced exactly the same problem after upgrading from Xcode 4.3 to 4.4. Only for 1 of my iOS projects, though. My solution was to create a new project and re-add all my source, dependencies (except KIF Integration Tests, which I haven't added yet) and other custom libs. After doing so I was finally able to debug my app on my iPhone and iPod Touch.

My setup is OSX Lion and Base SDK is Latest iOS (5.1).

Levins answered 31/7, 2012 at 8:7 Comment(0)
A
1

Try deleting the temporary folder for the app in your Library/Developer/XCode/DerivedData folder and rebuilding.

Aruspex answered 24/10, 2012 at 9:54 Comment(0)
H
1

The reason I want to add is all the above could not solve this problem:

And my steps are:

  1. Uninstall ur app on the device

  2. check if the info.plist files are duplicated (which I mean there could be two same plist for the same Products)

  3. Click on your project, check the "IOS Deployment Target" under the PROJECT and all "Deployment Target" under TARGETS are the same (most of the time, at this point, u could close xcode and restart, maybe it will work after this step)
  4. If it is still doesn't work, change you "Base SDK" from Latest iOS(iOS 6.0) to iOS 6.0(under your "Build Settings") for your PROJECT and TARGETS (quit xcode, cmd-q, or force quit, and restart again)
  5. after all those steps, it should work. (if the above doesn't work, u could still copy out the project and recreate a new one, don't do it til u hv no choices)

(PS: This is a really buggy problem, actually after I fixed it, and i changed everything back, it is still working.)

Forget at what I said above, I found the real quick way to solve this problem, force quit your Xcode, and restart it again, sometimes you will need to restart you device as well. Good luck guys, really get sick of this kind of problem.

Herl answered 13/3, 2013 at 3:41 Comment(0)
U
0

I ran across this issue this evening after an update to OSX. The project had been running fine previously. It turned out all that was necessary was a reboot. Still scary though.

Uneven answered 28/8, 2012 at 0:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.