8 Replies
      Latest reply on Mar 1, 2019 9:42 AM by smartcatPI
      bcprog Level 1 Level 1 (0 points)

        In one of my projects, all of the Xcode 10 betas (up through beta 6) generate warnings saying "missing creator for mutated node". I believe I tracked the warning down to the Core Data model code generator.

         

        Here's the basic set up:

        • iOS app is set up as a workspace using the "new" build system
        • Workspace contains an independent Xcode project with two targets (static library, resource bundle)
          • Static library includes a Core Data model file (no code generation)
          • Resource bundle compiles the Core Data model file and makes the compiled model available to the "resource" `NSBundle` at runtime
        • When building, a warning is generated stating "missing creator for mutated node"

         

        I can get the warning to go away using one of these workarounds:

         

        Workaround #1

        • Add a "dummy" entity to the Core Data model that allows code generation, the warning goes away.

         

        Workaround #2:

        • Use the "old" build system

         

        Has anyone else seen the "missing creator for mutated node" warning?

        • Re: Xcode 10 Warning - "missing creator for mutated node"
          smartcatPI Level 1 Level 1 (0 points)

          I have the same compile warning with my static library after switching up to Xcode 10 betas (currently beta 6).

          My static library also uses CoreData and its resource bundle target does indeed compile my CoreDataModel.xcdatamodeld.

           

          I've not tried either of your workarounds.  I'll just wait until GM and then re-evaluate.

          • Re: Xcode 10 Warning - "missing creator for mutated node"
            bcprog Level 1 Level 1 (0 points)

            FYI... The "missing creator for mutated node" warning still appears in the Xcode 10 GM seed. The workarounds I mentioned above are still working.

            • Re: Xcode 10 Warning - "missing creator for mutated node"
              smartcatPI Level 1 Level 1 (0 points)

              Now that I find I'm still seeing it in shipped Xcode 10.0, I'd like to understand further what you meant in your workaround #1.  Could you provide some steps as to how to add this "dummy" entity?  I assume I'd be editing my .xcdatamodel file by adding another entity... do I then select that new entity and in the Data Model inspector change the Codegen field from "Manual/None" to.... what?  And do I then need to do anything else like add a class file for this new dummy entity?

               

              All my entities have their Codegen field set to "Manual/None".  This is for a strictly Objective-C static library.

               

              Thanks!

                • Re: Xcode 10 Warning - "missing creator for mutated node"
                  bcprog Level 1 Level 1 (0 points)

                  smartcaPI... here's what I did:

                  • add a dummy element to your data model
                    • name the entity whatever you want (e.g. ABCDummy)
                    • attributes are not required
                  • select the "dummy" entity
                  • from the Data Model Inspector view
                    • change the "Codegen" property to "Class Definition"

                   

                  That's it... the warning(s) should go away. You don't need to touch any of your existing entities (i.e. code gen can stay set to "Manual/None".

                   

                  This currently works for me as of the Xcode GM release using the new build system.

                    • Re: Xcode 10 Warning - "missing creator for mutated node"
                      smartcatPI Level 1 Level 1 (0 points)

                      Hi bcprog,

                       

                      I followed your steps, and it indeed got rid of the build warning.

                      I then receivedt a link error, however.

                       

                      Undefined symbols for architecture x86_64:

                        "_OBJC_CLASS_$_NSFetchRequest", referenced from:

                            objc-class-ref in PIMCoreDataDummy+CoreDataProperties.o

                        "_OBJC_CLASS_$_NSManagedObject", referenced from:

                            _OBJC_CLASS_$_PIMCoreDataDummy in PIMCoreDataDummy+CoreDataClass.o

                        "_OBJC_METACLASS_$_NSManagedObject", referenced from:

                            _OBJC_METACLASS_$_PIMCoreDataDummy in PIMCoreDataDummy+CoreDataClass.o

                      ld: symbol(s) not found for architecture x86_64

                      clang: error: linker command failed with exit code 1 (use -v to see invocation)

                       

                      Note I'm building a "fake" framework, and this link error is in the resources target (to build my resources bundle file)

                      This target has the .xcdatamodeld in it's Compile Sources build phase.

                       

                      I solved that by linking CoreData.framework in my resources target, as I guess that's where the dummy code wound up.

                      Thanks again for you help!  Finally glad to be rid of this warning!

                  • Re: Xcode 10 Warning - "missing creator for mutated node"
                    davidfromcarolina Level 1 Level 1 (0 points)

                    Hey,

                     

                    In my case I have a "Resources" bundle and I was able to fix it by moving the resources on that bundle from "Compile Sources" (under "Build Phases") to "Copy Bundle Resources".

                    • Re: Xcode 10 Warning - "missing creator for mutated node"
                      nrith Level 1 Level 1 (0 points)

                      I just encountered this error today, and in my case, it turned out to be caused by the Carthage (https://github.com/Carthage/Carthage) build tool's copy-frameworks script. As soon as I deleted its build phase, my errors went away. This isn't ideal, since now it's more difficult to step into framework code, but it's better than not being able to build at all.