Reputation: 69
First of all the project I'm working at is written in Objective-C and I use XCode 8.3.2.
When I want to run my app in Debug-Mode I don't have any problems, it runs on simulator and on real devices.
But when I try to run the app in Release-Mode, then there are two errors:
ld: can't open output file for writing: /Users/rr/Library/Developer/Xcode/DerivedData/LehrerApp-abwqpnehycsrglaplrxtulrrlplf/Build/Intermediates/LehrerApp.build/Release-iphonesimulator/LehrerApp.build/Objects-normal/x86_64/LehrerApp, errno=21 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know there are already some answers here, but they didn't helped. I tried the following:
My Build Settings look as follows:
I don't know any further. Please help me, what can I do?
Upvotes: 3
Views: 5454
Reputation: 1
Make sure your file is not the same name as a folder in that directory.
Upvotes: 0
Reputation: 21
this can also happen if your executable is named after one of your current files in the same directory.
Upvotes: 2
Reputation: 2046
This error may occur if you add the root (folders / files) inside sub folder. So in my case I had a requirement for adding the images into the images folder. But instead of adding image, I added all the files present in my project folder. After a long time, found that there is something wrong within the project structure. So, I removed the reference of the duplicated files, now this error is no more. I hope this may help someone.
Upvotes: 3