While building my project for different target I am getting this error:
Could not determine generated file paths for Core Data code generation: Er
If you are using NSPersistentContainer, it is available from iOS 10+. You need to change the Target > General > Deployment Info > Deployment Target to 10.0+.
Then, Product > Clean & Build. It worked.
In my case I tried to build form an external drive. Copy the project to the internal drive, and it will work.
In my case, I was saving a new version of .xdatamodelid
in the pod project .xcworkspace instead of the original xcproject. Saving it in the original fix my problems.
The answers given above are just right, but if these do not work, then:
This solved my issue. Hope this helps.
Similar to shallowThought's answer, I found I had to first uncheck the target, and then re-check it, and then re-build.
In My Case it was a result of Model.xcdatamodeld having conflicts when Merged with Remote (Source or Head). Somehow this conflict wasn't detected by GIT and slid through as Conflict Free.
Resolution: Open Model.xcdatamodeld as xml (with textEditor) and search for conflicts (>>>). Fix conflict and Save.