139

Xcode has stopped being able to run my app, it started directly after I deleted it from the device and attempted to re-install by rerunning it in Xcode (something I've done hundreds of times before).

It says

"Could not launch XXX.app"

"No such file or directory (/Users/Mylaptop/Library/Developer/Xcode/DerivedData/MyApp-ekxcbebfpzkahtfkujyqkcwprzia/Build/Products/Debug-iphoneos/MyApps.app/MyApp)."

I've rebooted the phone, relaunched Xcode, cleaned everything, rebuilt everything. This error message won't go away.

This is with Xcode 4.5 which I've been using since it became available, if I revert to 4.3.2 then Xcode says "Finished running app" but it doesn't actually do anything - the app is neither installed nor run.

I'm completely stuck - unable to run anything on the device anymore.

Any suggestions?

Community
  • 1
  • 1
Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
  • 4
    Goto the Organizer in your xcode , press projects tab and delete the derived data for your project and clean the project and again build it.. – Dinesh Raja Jul 12 '12 at 16:29
  • 2
    Still get the same thing after doing that. I'll try a reinstall of Xcode. – Gruntcakes Jul 12 '12 at 16:40
  • I think you have changed something in your build settings in the path to run your app in device – Dinesh Raja Jul 12 '12 at 16:44
  • I hope you have some sort of backup to restore. If you don't I suggest making one now before you (possibley) do more damege. – Max Jul 12 '12 at 16:52
  • check the schemes you have. For launching the app, the path for the executable listed under the action (build, analyze, run, archive etc) may be pointing at a wrong place. – Nitin Alabur Jul 12 '12 at 16:56
  • 9
    I found out what it was - while adding device capabilities to the info.plist I had somehow added a new row but not given it a value. – Gruntcakes Jul 12 '12 at 17:10
  • I also ran into this with a bad capability requirement in info.plist. (I had added armv6 to the architecture list, and wanted to test on an armv6 device, but the info.plist still listed armv7 as a requirement.) – Andrew Plotkin Aug 02 '12 at 19:40
  • 1
    While deleting the derived data eventually worked for me, it didn't help until I rebooted the iPad and OS/X, emptied the trash after using the Finder to delete the derived data, and removed a BLE peripheral connected via a USB port. I don't know which of the steps was required--XCode later compiled with the BLE peripheral attached--but once all of those steps were added to deleting the derived data, the project compiled fine. – Mike Sep 20 '12 at 21:16
  • @Amino acids: Thanks for the tip. Same thing happened to me. Deleting the errant row on the plist fixed it. – JScarry Sep 27 '12 at 00:43
  • @Amino acids: +1 on the missing value in a plist row. Deleting it fixed it. Maybe you can answer your own question and accept it? Otherwise this "solution" gets buried in the comments. – UXUiOS Oct 09 '12 at 16:29
  • The problem for me was, as for others, a mysterious blank line in "Required Device Capabilities." Yet it manifests as a malformed file path: /users/{username}/..../appname.app/appname. The last part is clearly the problem, and how this could result from that blank line is deeply mysterious. – Chris Fox Jul 09 '13 at 08:46

34 Answers34

126

That is really annoying. This error happens in a number of different situations. Sometimes restarting the Xcode, fixes the problem. If not, follow these steps:

Disconnect your device.

Delete the app from your device.

Quit Xcode (Do not just simply close the window, quit it)

Delete derived data folder (~/Library/Developer/Xcode/DerivedData/-gbrvhlvwmpiobxdujegtghggrffp - or something like that)

Now start Xcode once again, connect device and run the project. It should work fine.

from DhilipSiva blog

dhilipsiva
  • 3,688
  • 1
  • 24
  • 35
Sudhakar
  • 1,517
  • 1
  • 10
  • 22
57

Try deleting "Required device capabilities" in the -Info.plist file.

You can't require armv7 on a 3G, and you can't require armv6 on any newer device, so just delete this attribute entirely.

Almog C
  • 795
  • 6
  • 14
  • 2
    This is the only sollution that worked for me. Already trying to refresh certificates, cleaning folders restarting device, xcode and mac nothing helped. Just delete the attribute and it installed and worked fine. – automaticoo Sep 02 '12 at 20:46
  • 1
    This solution also worked for me - weird error. – misnomer Sep 03 '12 at 12:13
  • I also had to make sure valid architectures in the setup included armv6, armv7 and armv7s (I'm using XCode 4.5 now... I know this has been a few months, but it's worth mentioning.) Also, these three should be listed in the Architectures section as well. – David Morton Sep 16 '12 at 21:01
  • Tried this, no joy but the Sudhakar + Jagger answer worked. Xcode 4.5.1 and an iPad1 – mm2001 Oct 26 '12 at 05:53
  • This was the problem for me: my app had "telephony" as a required capability and I was trying to run the app on an WiFi-only iPad mini. – chitza Jan 01 '13 at 15:27
  • This solution works for me, really annoying and weird error. – haxpor Feb 11 '13 at 09:22
38

I found the answer. The iOS deployment target's version was not the same as my device's OS version.

zekel
  • 9,227
  • 10
  • 65
  • 96
wihing
  • 541
  • 4
  • 9
13

First tried some of the above with info.plists and deleting derived data, clean, etc.

My solution: quit XCode, reopen project. Go to derived data in Finder. Deleted data for all projects (was all trashable, but I would try deleting your troubled projectdata first). And then it worked again. Deleting derived data from XCode didn't work.

10

The following resolved my problem... my app worked for me in debug/release, then I built a few ad-hoc archives and debug/release builds stopped working.

Symptoms:

  • invalid entitlements errors when launching from Xcode to device (play with entitlements...)
  • immediate abort with no error (finished running ) when running simulator
  • could not launch ... directory blabla.../build/product/debug-iphoneos/... not found when launching from Xcode to device.

Eventually after trying to benefit from everyone else's pain I found in Targets [AppName]:

Build Settings
Build Locations
Build Products Path build

should be

Build Products Path build/Products

No idea how this got set incorrectly. This must be hard-coded somewhere in Xcode/Springboard because 'Products' appears in both Xcode and in the Device console. This is Xcode 4.5.1.

screenshot fo where to set build/Products

Community
  • 1
  • 1
KeithL
  • 81
  • 1
  • 3
  • 1
    Could you format that to make the meaning a little more clear? It isn't obvious how it should be entered. – itsbruce Nov 01 '12 at 13:45
  • 1
    Wow, thanks a bunch Keith. After 4 frustrating hours it turns out this was the cause. How in the world it got changed is beyond me. – karl_ Dec 06 '12 at 18:04
  • 1
    Yeah it solved my problem, but why did this happen?! – Ali Jun 16 '13 at 14:10
7

I solved this problem by

renaming a directory above my XCode project

Changing the name of the project in XCode fixed it for me.

In XCode, under the Project Navigator, click the project name, and it should let you rename it just like a file in Finder. Deleting derived data did not help.

Mukul Goel
  • 8,387
  • 6
  • 37
  • 77
Scott Driscoll
  • 2,869
  • 2
  • 23
  • 22
  • That did it for me, for some reason it failed when I had a white space in the project name. Renamed to no white space and it run fine. – rita Dec 12 '16 at 19:17
6

I built my XCode Project with CMake and somehow it (or my stupid self) deleted or emptied the property "Executable file" in the info.plist. I set it back to ${EXECUTABLE_NAME} and it worked again.

Took me really alot of time working through all the suggestions and fixes until I finally found that problem.

Hope this will help some one struggling with the same problem

Edit:

It was in some way CMake messing up my plist file. I created my own Info.plist and used it the following way:

SET_TARGET_PROPERTIES( MyApp PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/MyApp.plist )

Inside my plist I had this entry:

<key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string>

Unfortunately CMake still seems to parse that file and replaced ${EXECUTABLE_NAME} with an empty string since its the CMake variable syntax. My quick work around is the following:

SET( EXECUTABLE_NAME "\${EXECUTABLE_NAME}" )

Now it works like a charm.

I am probably alone with exactly this problem, but who knows.

ecreif
  • 1,182
  • 1
  • 12
  • 25
  • Nice. I accidentally removed my .plist file and this was one of the properties I needed to add again. Thanks –  Mar 07 '13 at 23:52
  • The `set(EXECUTABLE_NAME "\${EXECUTABLE_NAME}")` was exactly what I needed. I added this line at the bottom of my ios toolchain file and it fixed it flawless. Thanks a bunch! – Erunehtar Jan 21 '15 at 16:41
5

I had the same problem, but in my case I had a wrong requirement in my info.plist (require gyroscope for an iPhone 3Gs)

Unfalkster
  • 683
  • 5
  • 12
4

I tried to run my project on a different system other than that on which it was developed. I was getting “Could not launch xxx.app: .. No such file..”.

Removed the app from the device and then deleted the derived data from organizer in xcode for the app. Organizer-->Projects-->Derived DAta-->Delete

My problem was resolved.

iSaalis
  • 622
  • 1
  • 8
  • 14
4

You need to set the deployment target LOWER than your device's version

Jim Huang
  • 401
  • 5
  • 9
4

For me, the solution was just to use the correct (non-distribution) provisioning profile.

I was defaulting to always using my ad hoc provisioning profile, but then I changed to using my developer profile (team profile) and that solved things. I went ahead and cleaned out the Derived Data directory to be safe but I don't know for certain if it is required.

XCode used to have a warning that told you to use the correct provisioning profile but that error message seems to have gone away in XCode 4.5.

TPoschel
  • 3,775
  • 2
  • 30
  • 29
  • This is certainly a catchall of fails and fixes, obviously a lot of XCode failures splat down into this unhelpful error message. THIS time, for us, and a few more below, it seemed to be caused by certificate/signing/profile problems, Tossing a few of the old expired ones, and making sure that I was using the same profiles everywhere, (Like Jabolcnik below, I have several dev accounts, my employer's and my own.) allowed XCode to run the app on the device. – Taryn Mar 08 '13 at 23:47
4

I've had this problem by a very strange solution.

My problem was slightly different as I have 2 Developer certificates in Keychain. We have two developer accounts (lets say AD and BD).

1) I did change Bundle identifier from com.BD.game to com.AD.game 2) Device on which I had problems was only signed in AD provisioning profiles. 3) I was unable to debug the game on iPad - although the device had valid provisioning profiles, I had valid certificates, I restarted Mac, device, reinstalled Xcode ... nothing helped.

Do what i did today was examining the project.pbxproj file for any strange entries.

What I found was that Xcode was using proper provisioning profile, but signed the ipa/app with wrong certificate.

"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: **BD** (XX******)";

After I manualy corrected the name and id; everything works like charm.

Jabolcnik
  • 41
  • 5
4

I got the same error. In my case I was set deployment target as 6.1 and trying to run an iOS 5.1 iPad. When I changed my deployment target to 4.3, issue solved.


Still having the problem . Try this Disconnect your device. Delete the app from your device. Quit xcode. Now start Xcode, connect device and run the project. It should work fine.

Nijil Nair
  • 1,608
  • 1
  • 11
  • 14
4

For me (using IOS 7 and Xcode 5), the error went away right after I did "Add to Member Center" with my device in the Organizer.

Bruce Cichowlas
  • 336
  • 1
  • 7
3

I would like to mention that the easiest way to open the DerivedData folder in Finder is the following:

  1. Open the Organizer.
  2. Click on "Projects".
  3. Select your problematic project.
  4. Next to the path of the DerivedData, click on the little right-arrow button.

Deleting the contents of the DerivedData folder worked for me. Instead of using the "Delete..." button, you should have more success deleting the files manually through Finder.

Adi Lester
  • 24,731
  • 12
  • 95
  • 110
user444731
  • 173
  • 1
  • 6
3

Go to: your project Target - > Info and from CustoM iOS Target Properties remove the Required Device Capabilities. In my case that were armv7 and armv7s.

After that the app was built successfully on my iPhone 4.

This is how it looks after i removed both of requirements

Dejan Balaban
  • 461
  • 4
  • 11
  • I was seeing the same problem, the app would run on my 5S the first time but not subsequent times, turned out my Required Device Capabilities were set to "armv7", removing that from the info plist fixed – Cam Saul Nov 10 '13 at 22:28
2

For me, I forgot that I had "telephony" in the "Required device capabilities" in the info.plist. Removed that, and it finally worked on my iPad.

ninjaneer
  • 6,951
  • 8
  • 60
  • 104
2

For me restarting of Xcode, cleaning DerivedData and restaring device wasn't enough in most cases, until I had figured out that iTunes was also running, and after quitting iTunes everything worked fine!

So my steps now are simple:

1. Quit Xcode.
2. If iTunes is running, quit iTunes.
3. Reopen project.

No need to remove app from the device, clean project or restart/disconnect device. I think that's because Xcode and iTunes use some common libraries (as you know, Xcode Installer always asks to quit iTunes on installing iOS SDK).

parametr
  • 1,023
  • 9
  • 5
2

I had this problem and tried a number of the suggestions which didn't work for me - then I found the one about removing the "Required device capabilities" in the -Info.plist file (which for me included location-services & gps) That worked! I then re-added them and it still worked.. go figure. This was xCode 4.6.1 & my app is developer with Phonegap/Cordova

2

I tried all the above and yet it still wouldn't run. I fixed the problem by changing the derived build location. File>Project settings>"derived data location" change to project-relative. Or you could just make sure the default path has permission to read/write.

wickedgk
  • 1
  • 1
1

My issue seemed to be picking picking Portrait (top home button) as Item 0 in Supported Interface orientations in my plist. Removing that or moving it down seemed to fix my problem. Go figure.

Becka11y
  • 96
  • 1
  • 6
1

I had this problem too for a Universal app with Xcode 4.5 on my iPhone ONLY, where I had two debug devices:

iPhone 4 iOS 5.1.1
iPad 1   iOS 5.1.1

The Info.plist had an empty entry under "Required device capabilities" I know that I did not enter this empty 'Item 0'. The app loads on the iPhone since I removed the empty item. I did not encounter this problem on any of several earlier versions of Xcode, This means that Xcode 4.5 handles this 'inserted' item differently for the two devices I use. I have been wrong before, but this does seem like a bug in Xcode 4.5.

mbarron
  • 285
  • 4
  • 15
1

This may seem obvious but you must also set your deployment target to the operating system that your device is running.

So if you upgrade to iOS 6, it will set your deployment target to iOS 6. You'll need to deploy to 5.1 if the device you are testing on still runs 5.1.

Matt Hudson
  • 7,329
  • 5
  • 49
  • 66
1

My issue finally got resolved by checking to make sure that the productName attribute in the /* Begin PBXNativeTarget section */ section of my project.pbxproj file matched the name attribute.

Once editing it so that they were the same, Xcode finally runs the app on my device correctly!

Thanks to Max Weisel for helping me! :D

Grantland Chew
  • 2,620
  • 26
  • 26
1

Deleting the derived data folder did not help for me. Using Xcode 4.4.2 the only solution was to open Organizer and delete old expired and extraneous provisioning profiles on the iDevice. Then everything worked perfectly again.

Robert Wasmann
  • 897
  • 7
  • 17
  • This is certainly a catchall of fails and fixes, obviously a lot of XCode failures splat down this no-man's-land. – Taryn Mar 08 '13 at 23:35
1

This may be a red herring, but I experienced these problems when I added custom launch images before deleting the default ones. Deleting the default launch and custom images and then adding back in the custom ones fixed it for me. I'm working with iOS 6 and Xcode 4.5.2

G O'Rilla
  • 268
  • 3
  • 5
1

There seems to be a few different things that can cause this very helpful error message.

For me, it was down to an incorrect "Required device capabilities" in the Info.plist. I had added a blank array item by mistake (on top of the the architecture, armv7). Deleted the blank array item and now everything is fine!

MattP
  • 1
  • 1
1

I had this problem and nothing really helped except: My problem started after changing the contents of my info.plist and no reverting had helped.

What solved it for me was:

  1. Create a vanilla info.plist in a brand new project
  2. replace the old info.plist with the new
  3. renaming it (like app_info.plist)
  4. Set Build Settings/Packaging/INFOPLIST_FILE to be the new one.
  5. Make all the changes you need for your project

Hope that helps. I tried everything else suggested here and this was the only solution for me.

1

Facing same problem but now problem is solved, i deleted Executable file info.plist. I set it back to ${EXECUTABLE_NAME} and it worked again.. :)

enter image description here

Rajneesh071
  • 30,846
  • 15
  • 61
  • 74
1

In my case i just set 777 permission directly to xxx.app folder to all files and work!

0

I solved this problem by selecting 'none' as my executable in build settings, shutting down xcode and manually deleting all of the derived data from ~/Library/Developer/Xcode/DerivedData, and then selecting the default executable after relaunching xcode. Not too sure what is causing this, though.

cmyr
  • 2,235
  • 21
  • 30
0

I was working with a workspace. Main project was linked with some library projects. Initially project was running fine. Suddenly it topped running. After sometime I noticed that the target for which project was getting built somehow changed from Main project to library project which was disabling the run option. Change the taret to Main project fixed it. I am still wondering how did it change.

Pratik
  • 211
  • 2
  • 3
0

I had this same problem except that the project run on one of the test iPhones but not on another. The error was exactly the same as the one you posted though. The problem was that in Build Settings > iOS Deployment Target, it was set to 5.1 and only one device had that OS. After I changed it to 5.0, both devices worked fine.

Julian
  • 8,808
  • 8
  • 51
  • 90
0

NONE! of the above Answers worked for me. I just did -> Go to your main project target->"Build phases"->"Target dependencies" add your project dependencies if any.

Project did run like a charm :)

Mohd Asim
  • 2,171
  • 1
  • 18
  • 15