11

I am receiving the following error when I try to run my Xcode iOS project:

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

I have had this error for a while now. I was able to get around it by using an actual device instead of a simulator, but now that doesn't work either. I haven't changed a single setting in the project since creating it, all that I have changed is the code itself. This has also happened before and the only way I fixed it was to create a new project and start from scratch and now it is happening again from that. I am so frustrated! I have no idea what to do. What info do I need to provide to help diagnose this? I am using the facebook sdk 3.1 if that means anything.

Thanks

Anil
  • 2,539
  • 6
  • 33
  • 42
linuxer
  • 523
  • 2
  • 4
  • 22
  • That's not what I am saying. I am trying to run an iphone project made in xcode and I get that error – linuxer Nov 06 '12 at 19:29
  • Did you try cleaning the project? –  Nov 06 '12 at 19:33
  • Yeah, I have cleaned it, restarted the computer, deleted the derived data. – linuxer Nov 06 '12 at 19:35
  • Haha, I wish. Xcode really has gotten crappy. Is it possible to develop for the iPhone in linux? – linuxer Nov 06 '12 at 19:37
  • yep. http://github.com/H2CO3/xchain-ios (even better: [prebuilt version.](http://code.google.com/p/mingw-and-ndk/downloads/detail?name=multiarch-darwin11-cctools127.2-gcc42-5666.3-llvmgcc42-2336.1-Linux-120724.tar.xz&can=2&q=)) –  Nov 06 '12 at 19:40

10 Answers10

14

Target -> Build Settings -> Build Options set the "Compiler for C/C++/Objective-C" - "Default compiler (Apple LLVM 5.0)" and the issue will be solved

Artur
  • 336
  • 3
  • 10
11
  • Clean up your project using Clean, Clean folders, Delete derived data.
  • Delete all schemes from 'manage schemes'. Recreate them, and build using any of them that contains a version of iPhone simulator (the one that worked earlier).

If that doesn't work, try this:

  • Clean up your project using Clean, Clean folders, Delete derived data.
  • Using your favourite editor, try clearing all the profile strings from your project.pbxproj file (the one that you see when you open your xcode project using 'Show Package Contents' command).

See below image - you must delete all lines containing 'Provisioning Profile' till the ; character.

  • Then restart xcode. Select the profile using automatic profile selector and build using an iphone simulator scheme.

enter image description here

Nirav Bhatt
  • 6,940
  • 5
  • 45
  • 89
  • I posted based on earlier instance when I got this error and resolved it. However, there seems to be some recent reasons that cause this: http://stackoverflow.com/questions/12540534/xcode-4-5-4g182-iphone-5-ios6-choose-a-destination-with-a-supported-archit – Nirav Bhatt Nov 06 '12 at 19:59
  • And this too: http://stackoverflow.com/questions/11767945/xcode-cannot-run-on-the-selected-destination?lq=1 – Nirav Bhatt Nov 06 '12 at 20:01
  • Oh my gosh! Thanks! This has been frustrating the crackers out of me. Thanks again! – linuxer Nov 06 '12 at 20:12
  • Well, it partially fixed it anyway. I still can't run it on the simulator, but it does work on a device. – linuxer Nov 06 '12 at 20:15
  • Glad could help. As for simulator, you may want to first reset all its apps. Then, give a try clearing derived data - not from organizer, but from finder. In organizer where it shows derived data, there is a tiny arrow that takes you there. Click and open it in finder. Now remove all app id folders from this location, instead of just yours. You may have to trash them once or twice sometimes. Do it until XCode clears it up in organizer. Then come back to XCode fire again. – Nirav Bhatt Nov 08 '12 at 06:23
2

Check that the Executable File (also known as CFBundleExecutable) in the Info.plist file is set to ${EXECUTABLE_NAME} as opposed to any hardcoded value. This will ensure that even if you change your project name or target name or scheme name, that it still works.

jsherk
  • 6,128
  • 8
  • 51
  • 83
1

Please Check the following: -Connect your device with another cable. -Check if the cable is properly connected. This was my problem Thanks

araferna
  • 71
  • 1
  • 5
1

I had this error when trying to run a DEBUG build. I changed "Build Active Architecture" to YES for DEBUG and this error finally went away after hours of frustration. I tried about 10 different things that I read on this site and nothing else worked.

jbcaveman
  • 911
  • 1
  • 10
  • 19
1

I found the error was because of unsupported compiler in building settings. Check Project Building Settings --> Build Options --> Compiler for C/C++/Objective-C. Change to "Default compiler (Apple LLVM 5.0)". Everything is OK.

passwind
  • 149
  • 5
0

I had this error when trying to test my app. Here's what worked for me:

In Targets > Build Settings, I changed the Product Name to match the Target name and this fixed it for me.

TheGrayVacuum
  • 703
  • 2
  • 7
  • 12
0

I had the same problem, and fixed it by opening the info.plist file in Resources and unchecked the target membership so that nothing is checked as target membership.

Fabian
  • 1
0

I solved by rebooting mac (also have rebooted iPad)

Gank
  • 4,507
  • 4
  • 49
  • 45
0

In XCode 6 I opened the Devices window (Window/Devices) and noticed my iPhone was not listed there, even though it was plugged in to the mac at that time. I unplugged it and then plugged it right back in while the Devices window was open, and it appeared in the device list and also in the scheme picker.

andrewz
  • 4,729
  • 5
  • 49
  • 67