Xcode Ignoring Import

Xcode - Test class File is part of module, ignoring import

I just stumbled on the same problem, and your post was helpful. What I found out is by change the Product Name to AppNameTests, as per your example, then the product module name is reflected correctly and you don't have to add Tests at the end of $(PRODUCT_NAME:c99extidentifier). c99extidentifier seems torefers to Product Name.

Summary:

  • select your test target in Project
  • navigate to Build Settings -> Packaging
  • change the Product Name to your previous test target, likely appending Tests
  • I believe the rename as per Apple's renaming a project doesn't include the updating the module in @testable, so I had to do this manually

Xcode Ignoring import

Your project is named SwiftUI - please try using a different name.

file viewController.swift is part of module coreData ignoring import

Is your project name "CoreData" ? You can't call your project with the name of a module. Try creating another project with another name

Xcode: File 'GameViewController.swift' is part of module 'SceneKit'; ignoring import

This issue has nothing to do with the template. A very common mistake that (I made too) is to name the project same as one of the using frameworks! (e.g. CoreData, SwiftUI, SceneKit, Metal)

Solution

Don't name your project same with another module. Change it to anything else.


Note that It could be appear as error too. For example if you name your project CoreData and using SwiftUI, the error appears as Circular dependency error:

Circular dependency between modules 'CoreData' and 'SwiftUI'

Because Xcode gets confused about modules and can not detect what the real issue is.



Related Topics



Leave a reply



Submit