Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode builds on Debug but not on Release

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.

like image 669
user1289479 Avatar asked Jan 16 '23 13:01

user1289479


2 Answers

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.

like image 116
David H Avatar answered Jan 26 '23 02:01

David H


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.

like image 23
Totoro Avatar answered Jan 26 '23 01:01

Totoro