ProjectName-Swift.h Not Found / Generated Xcode 10
Asked Answered
R

1

6

Running my project in Xcode 10 throws me this error

fatal error: 'Stories-Swift.h' file not found

I've tried multiple things including:

  • Adding a new swift file to the project and rebuilding it
  • Setting Defines Modules to Yes
  • Double checking my SWIFT_OBJC_INTERFACE_HEADER_NAME and setting it to $(PROJECT_NAME)-Swift.h

I checked my derived data, and there are no traces of ProjectName-Swift.h.

Am I missing something obvious, TIA.

Raynaraynah answered 24/9, 2018 at 17:48 Comment(2)
Finally managed to fix this. First step was to switch to the old build system. This can be done by changing compilation mode from Incremental to Whole Module This showed me the actual errors in the project that prevented Xcode from creating the ProjectName-Swift.h. Once this is completed, I added a new Swift file with a class that conforms to NSObject and @objc and run the project.Raynaraynah
"This showed me the actual errors in the project that prevented Xcode from creating the ProjectName-Swift.h" What were those errors? Can you give us a few examples?Adapa
D
-4

I faced something similar before. Usually this happens when the file (Stories-Swift.h) is not physically located in the folder of your project but there is a reference to it in the Xcode project. Delete the reference from Xcode. Clean. Find that file (make sure its physically in your project folder) and then drag in back to Xcode. Then clean + build.

Drown answered 25/9, 2018 at 1:10 Comment(1)
that's not a practical solutionAllysonalma

© 2022 - 2024 — McMap. All rights reserved.