Main_iPhone.storyboard: Compilation failed. Unable to write to path: - ios

Here is the entire log
/Users/myname/reponame/projectname/projectname/Base.lproj/Main_iPhone.storyboard:
Compilation failed. Unable to write to path: /Users/myname/Library/Developer/Xcode/
DerivedData/projectname-csxwagvbpfvfsmbgswcukqirbmgg/Build/Products/Debug-iphoneos/
projectname.app/Base.lproj/Main_iPhone.storyboardc
Underlying Errors:
Description: The file “Main_iPhone.storyboardc” couldn’t be saved in the folder “Base.lproj” because a file with the same name already exists.
Failure Reason: A file with the name “Main_iPhone.storyboardc” already exists.
Recovery Suggestion: To save the file, either provide a different name, or move aside or delete the existing file, and try again.
Underlying Errors:
Description: The operation couldn’t be completed. File exists
Failure Reason: File exists
Description: “Main_iPhone.storyboardc” couldn’t be removed because you don’t have permission to access it.
Failure Reason: You don’t have permission.
Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > Get Info.
Underlying Errors:
Description: The operation couldn’t be completed. Directory not empty
Failure
I am afraid of doing something I don't understand and end up breaking my code further. Does anyone know how to fix this issue? Should I do ahead and delete the direction? To the best of my knowledge the problem arose out of the blue.

Make sure that your story board not appears more than one in Build phases -> Copy bundle resources , If yes then remove one it will solve the issue.

I ran into the same problem today. Simply deleting /Users/myname/Library/Developer/Xcode/
DerivedData/projectname-csxwagvbpfvfsmbgswcukqirbmgg/ should solve your problem. You may also need to exit xcode and restart it.

Cleaning my project worked for me, as mentioned in this post . Adding a link in case people find this page but not the other.

I had the same problem. My mistake was that one of my storyboard ids included a "/". After I removed it everything worked fine. Hope it will help you.

Related

Storyboard file will not open after interfaceBuilder throws error -1

I work with GIT, and after pull/pushing the project repository, I went to run the application to test I pushed a working version. However, after running the app, I am struck with this error immediately upon compile:
"The document "Setstory.storyboard" could not be opened. The operation couldn’t be completed. (com.apple.InterfaceBuilder error -1.)"
I am running the latest version of XCode(7.0.0) and OSX 10.10.5.
I have tried googling this for an entire day, and still have not been able to figure it out. Has anybody else seen this?
Your storyboard contain merge conflicts. Resolve them, and then try opening it then.

Build failed--attribute must have a defined type

My app crashes on build. Here's the error in it's entirety:
DataModelVersionCompile /Users/AAAAAAA/Library/Developer/Xcode/DerivedData/XXXXXXXXXX-envirswdnpegjccdpxakhoykfnfq/Build/Products/Debug-iphonesimulator/XXXXXXXXXX.app/WMMGDataModel.momd XXXXXXXXXX/WMMGDataModel.xcdatamodeld
cd "/Users/AAAAAAA/Desktop/Everything from DT 1:20:15/App projects/WMMG/XXXXXXXXXX"
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/momc -XD_MOMC_SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -XD_MOMC_IOS_TARGET_VERSION=8.1 -MOMC_PLATFORMS iphonesimulator /Users/AAAAAAA/Desktop/Everything\ from\ DT\ 1:20:15/App\ projects/WMMG/XXXXXXXXXX/XXXXXXXXXX/WMMGDataModel.xcdatamodeld /Users/AAAAAAA/Library/Developer/Xcode/DerivedData/XXXXXXXXXX-envirswdnpegjccdpxakhoykfnfq/Build/Products/Debug-iphonesimulator/XXXXXXXXXX.app/WMMGDataModel.momd
/Users/AAAAAAA/Desktop/Everything from DT 1:20:15/App projects/WMMG/XXXXXXXXXX/XXXXXXXXXX/WMMGDataModel.xcdatamodeld/WMMGDataModel 5.xcdatamodel:WMMGAccount.attribute: error: WMMGAccount.attribute must have a defined type
/Users/AAAAAAA/Desktop/Everything from DT 1:20:15/App projects/WMMG/XXXXXXXXXX/XXXXXXXXXX/WMMGDataModel.xcdatamodeld:0: error: Compilation failed for data model at path '/Users/AAAAAAA/Library/Developer/Xcode/DerivedData/XXXXXXXXXX-envirswdnpegjccdpxakhoykfnfq/Build/Products/Debug-iphonesimulator/XXXXXXXXXX.app/WMMGDataModel.momd/WMMGDataModel 5.mom'
Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/momc failed with exit code 1
The relevant part seems to be:
/Users/AAAAAAA/Desktop/Everything from DT 1:20:15/App projects/WMMG/XXXXXXXXXX/XXXXXXXXXX/WMMGDataModel.xcdatamodeld/WMMGDataModel 5.xcdatamodel:WMMGAccount.attribute: error: WMMGAccount.attribute must have a defined type
I've gone into my xcdatamodel, but can't find any attributes that aren't properly defined by type. One suspicious thing I'm seeing is the reference to WMMGDataModel 5. I'm up to version 8 in my model, and can't even find version 5.
This crash began after a recent automatic migration (using MagicalRecord) in which I added an attribute to one of the entities and then recreated the Managed Object Subclass (yes, the new subclass contains the new, properly defined attribute). I've added attributes before, but this is the first time I've encountered this issue.
I've cleaned the thing, quit and restarted Xcode, still crashes. Anybody have any ideas? I also deleted the DerivedData folder for the project. Still won't build.
Edit:
I just recreated all my managed subclass files. Still no dice--same error message.
Edit:
I tried running another project as a control, and got this message:
Unable to run app in Simulator
An error was encountered while running (Domain = FBSOpenApplicationErrorDomain, Code = 4)
So I quit Xcode and the simulator, restarted Xcode. Same error.
Yet more info
I restarted the computer and tried again, but am still getting "Build Failed" with the same error message.
If anyone else has run into anything like this, I sure would appreciate some guidance here... :)
Final edit
Please see solution in my answer below...
Ok, I finally cured the problem with a decision to delete my xcdatamodeld and rebuild the entire model. Some research into how to do this yielded a less destructive and less risky method in this answer.
Here's hoping it will help someone else with this problem.
Thanks to all who took a look!
I've never had the problem you describe, but have a few suggestions. Apologies if you've already tried these:
First, in the model editor, can you access the model version 5 that you suspect is the problem, eg.:
If it's there, you can hopefully fix the attribute error. If it doesn't appear there, have you tried right-click in the Project Navigator and select "Show in Finder":
Then in Finder looking for the version 5?

build failed with error 'file not found' and 'linker command failed with exit code 1 '

I really searched stackoverflow for hours and on the internet, but couldn't find the answer why its happening. So before I create a new project I decided to post a question here.
Using Xcode 6.
Thanks in advance.
try to delete derived data from the organiser for the app.
or
try reset simulator than clean and run the app
So I've found the solution. So apparently when you try to change your bundle id, it's better not to change the whole project name, just the bundle id in the .plist file.
What I did is to change to whole project name and than the error occurred, maybe some kind of bug, when I changed it back to what it was before, the issue has been fixed and the build succeeded.
If you want to change the bundle id, do it from the .plist file.
Hope it helped you.

Compile Time Error - Corrupt XIB/NIB in XCode 4.1, iOS 4

Could anyone suggest what this error might be caused by and suggest any possible solution? This is a compile time error and doesn't seem to have anything to do with code as the file in question is a xib.
The series of events which seems to lead to this error was:
Write project
Save project to USB drive
Open project at different location
This suggests to me that the problem is internal to XCode or there was corruption when copying to the USB but I haven't been able to verify either of those options. If anyone could shed some light on this, I'd be very grateful.
The solution was to re-create the nib as no attempt to rescue the current one or replace it with an old copy was successful.
If anyone has has the same problem and did find a way to solve it without re-creating the nib, I'd still like to know please!

CoreData warning: Unrecognized optimized model archive format

When running my iOS program on an iPad, the console gives the following error when opening the CoreData data store:
CoreData warning: Unrecognized optimized model archive format
Failed to load optimized model: Error Domain=NSCocoaErrorDomain Code=134060 "The operation couldn’t be completed. (Cocoa error 134060.)" UserInfo=0x150160 {Root cause=Unknown archive format}
Anyone got any ideas what this means? and how to fix?
Thanks.
Glen.
It's always hard to say whether or not this was the fix, because it seems that what works for some people in Xcode doesn't work for others, but the way I finally got rid of this error was by cleaning the project and rebuilding.
Prior to that, I tried to delete the app and run the project again (without cleaning), but that still generated the error, so I think it just has to do with a cached model in the build folder that's messing up its ability to "load the optimized model".
Hope this helps!

Resources