Could not determine generated file paths for CoreData code generation

后端 未结 11 1517
小蘑菇
小蘑菇 2021-01-01 11:23

While building my project for different target I am getting this error:

Could not determine generated file paths for Core Data code generation: Er

11条回答
  •  暖寄归人
    2021-01-01 11:59

    In my case, I had renamed the directory in which my .xcdatamodel resided, which resulted in the old filename entry not being removed from my Target's Compile Sources phase.

    All I had to do was remove the old file from the Compile Sources phase, by searching for xcdatamodeld and removing the relevant (now irrelevant...) entry in my target's Build Phases tab:

    • Don't forget to do this for ALL the targets that contain your Core Data data model.

    Once you're done, make sure that your actual current .xcdatamodeld file is added to your target. You do this:

    a) By clicking on the file in Xcode's Project Navigator (left column -> first icon):

    b) And then ticking the boxes of all targets that you want this file to be a part of, in Xcode's File Inspector (right column -> first icon), under Target Membership:

提交回复
热议问题