Xcode suddenly stopped running project on hardware: "Could not launch xxx.app: .. No such file.."

IosXcode

Ios Problem Overview


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?

Ios Solutions


Solution 1 - Ios

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

Solution 2 - Ios

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.

Solution 3 - Ios

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

Solution 4 - Ios

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.

Solution 5 - Ios

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

Solution 6 - Ios

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.

Solution 7 - Ios

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.

Solution 8 - Ios

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

Solution 9 - Ios

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.

Solution 10 - Ios

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

Solution 11 - Ios

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.

Solution 12 - Ios

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.

Solution 13 - Ios

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.

Solution 14 - Ios

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.

Solution 15 - Ios

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.

Solution 16 - Ios

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

Solution 17 - Ios

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.

Solution 18 - Ios

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).

Solution 19 - Ios

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

Solution 20 - Ios

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.

Solution 21 - Ios

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.

Solution 22 - Ios

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.

Solution 23 - Ios

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.

Solution 24 - Ios

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

Solution 25 - Ios

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.

Solution 26 - Ios

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

Solution 27 - Ios

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!

Solution 28 - Ios

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.

Solution 29 - Ios

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

Solution 30 - Ios

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

Solution 31 - Ios

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.

Solution 32 - Ios

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.

Solution 33 - Ios

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.

Solution 34 - Ios

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 :)

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
QuestionGruntcakesView Question on Stackoverflow
Solution 1 - IosSudhakarView Answer on Stackoverflow
Solution 2 - IosAlmog CView Answer on Stackoverflow
Solution 3 - IoswihingView Answer on Stackoverflow
Solution 4 - IosJoris van Liempd iDeveloperView Answer on Stackoverflow
Solution 5 - IosKeithLView Answer on Stackoverflow
Solution 6 - IosScott DriscollView Answer on Stackoverflow
Solution 7 - IosecreifView Answer on Stackoverflow
Solution 8 - IosUnfalksterView Answer on Stackoverflow
Solution 9 - IosiSaalisView Answer on Stackoverflow
Solution 10 - IosJim HuangView Answer on Stackoverflow
Solution 11 - IosTPoschelView Answer on Stackoverflow
Solution 12 - IosJabolcnikView Answer on Stackoverflow
Solution 13 - IosNijil NairView Answer on Stackoverflow
Solution 14 - IosBruce CichowlasView Answer on Stackoverflow
Solution 15 - Iosuser444731View Answer on Stackoverflow
Solution 16 - IosDejan BalabanView Answer on Stackoverflow
Solution 17 - IosninjaneerView Answer on Stackoverflow
Solution 18 - IosparametrView Answer on Stackoverflow
Solution 19 - IosDylan Hamilton-FosterView Answer on Stackoverflow
Solution 20 - IoswickedgkView Answer on Stackoverflow
Solution 21 - IosBecka11yView Answer on Stackoverflow
Solution 22 - IosmbarronView Answer on Stackoverflow
Solution 23 - IosMatt HudsonView Answer on Stackoverflow
Solution 24 - IosGrantland ChewView Answer on Stackoverflow
Solution 25 - IosRobert WasmannView Answer on Stackoverflow
Solution 26 - IosG O'RillaView Answer on Stackoverflow
Solution 27 - IosMattPView Answer on Stackoverflow
Solution 28 - IosCapi Yoav KedemView Answer on Stackoverflow
Solution 29 - IosRajneesh071View Answer on Stackoverflow
Solution 30 - IosArthur GoulartView Answer on Stackoverflow
Solution 31 - IoscmyrView Answer on Stackoverflow
Solution 32 - IosPratikView Answer on Stackoverflow
Solution 33 - IosJulianView Answer on Stackoverflow
Solution 34 - IosMohd AsimView Answer on Stackoverflow