In one of my project, I am using CoreData to store all local data and it was working absolutely fine till xcode 5.1.1. But with the upgrade to xcode 6, I started getting compilation error. The error looks like this:
/Users//Desktop/test/test/test.xcdatamodeld: Compilation failed
for data model at path
'/Users//Library/Developer/Xcode/DerivedData/test-bheksmasmjewxsejmxeyasvvhrer/Build/Products/Debug-iphonesimulator/test.app/test.momd/test.mom'
I tried searching SO for the issue, found some suggestions and implemented them in my project as well. But none of the suggestions worked for me and am left wondering "what the h**l this issue is. Any hint/suggestion/solution will be a great help right now.
Thanks
Not sure if you ever resolved this issue, but I had the same issue after I erroneously versioned my data model. I found the steps below fixed my issue:
In Xcode locate your .xcdatamodeld file then click "Show in Finder" and delete the .xcdatamodel file that was not previously visible in Xcode or that was erroneously versioned.
Hope this helps you in some way, if you are still looking for answers.
Related
I have updated my Xcode to the latest version of 8.0
After the update, I am facing a new build error preventing me to run the project on the simulator.
The error is the below in DDXMLNode.m:
reference to 'XML_DOCUMENT_NODE' is ambiguous
I am using the XMPP framework as pods (pod 'XMPPFramework') so I still can't figure out a way to solve this.
Note that the project is working normally on the device and was working on both Device and Simulator with the previous Xcode Version.
I have tried to search the internet but I still didn't find any solution for this.
I tried to clean the project and delete everything in the DerivedData folder as well, but it didn't solve the issue.
Appreciate any help.
Actually I am posting this answer in case it may help someone in the future.
After searching a lot without finding any answer, I discovered the following:
There is a file called module.modulemap that contains 2 methods.
module libxml [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
module libxmlSimu [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
The first one is used for real devices, the other one for the simulator.
However, when building the app on the simulator, and for a reason that I didnt figure it out, tree.h is being duplicated and causing all these issue.
So what I made to be able to run the project on the simulator was to comment the first method so the app can build successfully.
NB: Don't forget to uncomment the method once you want to run the project again on the real device.
Hope this will help anyone who will face the same issue.
i have tried some way.
I search the word XML_DOCUMENT_NODE with a result here:
then replace every error with the left symbol. It turns out to be OK for me now.
I've added new model version before in this project but for some reason I cannot add them now. When I right click on ****.xcdatamodeld and select "Add model version" from Editor menu. New version is showing up in Finder when I click "Show in Finder" but not under ****.xcdatamodeld nor in File Inspector??? I cannot add them manually under ****.xcdatamodeld as well.
I've added Apple Watch support in my project recently, in case if this information helps.
To be honest, I don't think I found a satisfactory answer but a few workarounds to what I think is a bug.
A solution here refers to incorrect directory structure, I did not give this a try as the xCode versions seem quite old but maybe it might help you: Issues with directory structure
This seems like a hack which worked for some, even in xCode 7.2
While none of these options worked for me, even quitting xCode, restarting Mac, I just had the beta 7.1 lying around, adding a new version worked perfectly and then I switched back to 7.3 to continue the rest.
To be honest, I don't think I found a satisfactory answer but a it solved my problem.i created a new project, in that project I did my model versioning(in latest xcode) and copied that model object in to my project.It works well.
Having just experienced watching nothing happen after selecting Add Model Version, I quickly found (stumbled upon) a solution that works. Credit goes to Shawn's hack link, in which Mundi points to the xcdatamodels.
Alt-select an xcdatamodel and then Show in Finder
Quit Xcode
In the Finder folder with all the versions, I found one version already existed (but wasn't showing in Xcode) with the version I had tried to make several times.
Delete this imposter!
Open Xcode and try Add Model Version
The new version was added.
Hey I keep getting this error. I think its because earlier i deleted everything in derived data folder and now i get this error when i try to run my project this is a new little test project I'm doing for the apple watch does anybody know how to fix it? Thanks
I recognize this issue and I tried to restart Xcode, my computer, clear cache, clean etc when I also had this problem, without any luck. The only thing that got it working for me was to completely uninstall Xcode and remove all files. Check this post of how to do that.
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?
Has anyone seen this and know how to fix it?
/Users/venerley/dev/Phase3-Dev-iOS-DB/WTInstrument.3/Persistence/DataBase/WTModel.xcdatamodeld:
Could not create bundle folder for versioned model at
'/Users/venerley/Library/Developer/Xcode/DerivedData/WirelessTouch-gmsbhbucobwnlqcijbkyknnkktuu/Build/Products/Debug-iphoneos/WirelessTouch.app/WTModel.momd'
This problem occurs when building for arm64 devices. Using Xcode Version 5.1 (5B130a) & iOS 7.1.1
not sure if this makes sense to anyone? however this error message turned out to be a red herring.
The problem was due to the use of libCorePlot-CocoaTouch.a not being built for arm64. When this was fixed the database problem disappeared too!
I would be interested to hear from anyone who can explain how/why the libCorePlot-CocoaTouch.a file could interfere with the compilation of the database.
Face the same problem
I just created new model with new name and copy all the entity from old model and paste in new model and deleted old model, it worked