Could not determine generated file paths for CoreData code generation

后端 未结 11 1460
小蘑菇
小蘑菇 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:50

    In Xcode, select your Model.xcdatamodeld model and tick the checkbox "Target Membership" for your new target in the Inspector.

    0 讨论(0)
  • 2021-01-01 11:56

    Module Inspector > Module > Current Product Module

    Clean and Build afterwards.

    0 讨论(0)
  • 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:

    0 讨论(0)
  • 2021-01-01 12:00

    In my case in File Selector Code Generation was Selected as Swift. As I selected Code generation language as Objective-C. Error Disappeared.

    After selecting Objective-C

    Product > Clean

    and then Rebuild the project.

    This worked for me.

    0 讨论(0)
  • 2021-01-01 12:03

    Just Clean and Build worked for me after adding Core Data manually (not from the start of the project).

    0 讨论(0)
提交回复
热议问题