10
votes

I have a Mac app I have written to support iCloud. However, I get this when trying to run the app:

error: failed to launch /Users/padsoftware/Library/Developer/Xcode/DerivedData/Scrawl-heofvoywsunchdhjowxkvkoiqvan/Build/Products/Release/Scrawl.app/Contents/MacOS/Scrawl

The odd thing is that this appears for all of my Mac apps, with or without iCloud, with or without sandboxing, with or without entitlements, or ever with or without code signing. Any idea on how to fix this?

7
three things I'd suggest... A) do a full clean, then build and try again B) delete that DerivedData folder (I think it's analagous to a cache) and try again and if that doesn't work, you may need to uninstall and reinstall XCode. - Michael Dautermann
I already tried reinstalling Xcode. I did as you suggested, but sadly that didn't help. Edit: I am running Xcode 4.2.1 and OS X Lion 10.7.2. - user1103804
do you have the same problem when you do "Build for Testing"? What happens when you double click the actual built app from the Finder? - Michael Dautermann
"Do you have the same problem when you do "Build for Testing"?" Yes, I have the same error. "What happens when you double click the actual built app from the Finder?" The app doesn't launch. - user1103804

7 Answers

26
votes

I had this problem too. For me, it was a code sign issue. Make sure you're signing with developer, not distribution.

6
votes

I encounter this problem every once in a while. Like the others mentioned, these are the steps I take:

1. Clean (Shift+Cmd+K) ------ Removes all the product files, as well as any object files (.o files) or other intermediate files created during the build process (Apple Doc)

2. Navigate to "~/Library/Developer/Xcode/DerivedData", delete folder for app in question ------ Derived data consists of project indexes, logs, and build products including intermediate files (Apple Doc)

3. Restart Xcode

One or the other usually fixes it. I haven't had to change Code Signing settings, but that would be my next step. Wouldn't re-install Xcode unless absolutely necessary.

3
votes

I had such problem also and restarting Xcode Fixed the issue .

even it happened after renaming the application ....

2
votes
  1. Under Build Settings make sure you are signing with a valid developer profile for debug and release.
  2. Then Build for Testing

That fixed the problem.

2
votes

"Product"->"Scheme"->"New Scheme" fixed my problem

0
votes

Just in case it helps anyone else, my problem was fixed by rebooting my iPhone (4S). Then the app suddenly appeared on the Springboard (it was like it was already installed but somehow hidden).

...I did all the other steps (restart Xcode, clean project, delete derived data) but none of it worked this time.

0
votes

What worked for me... I was already code signed as developer so I cleaned my code menu bar -> Product -> Clean

That still didn't fix it but I noticed that I was getting handshake error, I had a large amount of apps already running on my phone (~15-20) so I exited out of all of them and retried. It worked after exiting out of all other apps.