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.

Giridhar
  • 104
  • 1
  • 6
  • 4
    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. – Giridhar Sep 26 '18 at 07:25
  • "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? – Oscar May 07 '19 at 19:34

1 Answers1

-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.

Muhammad
  • 109
  • 1
  • 9