4
votes

So, I have this problem when trying to build my project.

Currently If I run the project in Debug mode, it runs fine, the app starts up on the device and I can test stuff.

However the weird part is when i switch over to the Release build and try to build on the device. When I press the Run button Xcode builds as normal and the build succeeded notification even pops up, but then I get this error code.

Lets call my app xxx

Could not launch "xxx.app"

No such file or directory:

/Users/*my Name*/Library/Developer/Xcode/DerivedData/*Bunch of xcode folders*/Products/Release-iphoneos/xxx.app/xxx

I went into finder and searched up xxx.app and couldn't find it. Furthermore there doesn't even exist a Library folder under /Users/my Name/.

So what is xcode trying to do here, and what should I do to fix this?

Edit: I have also tried Cleaning the project and building again, the error code still comes up.

3
The Library folder is hidden by default. Use chflags nohidden ~/Library to unhide. - DrummerB

3 Answers

8
votes

I get this crap all the time.

What I do is clean the project, close it, shut down Xcode, start up Xcode, open project, then build and run.

If that still does not work then find the "DerivedData' folder Organizer->Projects and delete it, then do the above again and try again.

1
votes

I tried creating a new scheme and setting it to Release mode. That worked for me. However, a reboot after closing xCode seems to work, too.

0
votes

I went into finder and searched up xxx.app and couldn't find it. Furthermore there doesn't even exist a Library folder under /Users/my Name/.

It does exist, but it's hidden (since OSX Lion) in the Finder (because standard users -- as opposed to developers -- should not mess with it).

Some utilities (on a simple command line) can make it visible again but the simplest thing to do is to use "Go" menu of the Finder and select "Go to folder…" (Command-Shift-G). Then copy/paste the path you want to go to and validate.