3

I duplicated a target and get the following build error:

Resource/Prefix.pch:16:13: '<moduleName>-Swift.h' file not found

I can't see any difference between the two targets that would cause this problem.

Any ideas why this is happening?

Matt
  • 4,261
  • 4
  • 39
  • 60

2 Answers2

1

The problem is that the duplicate target has a different moduleName.

I had to add a C-flag in the duplicate target and use this in Prefix.pch. (A User-Defined Setting doesn't get seen when parsing the pch file.)

enter image description here

#ifdef DEVLOPMENT_SERVER
    #import "<duplicateModuleName>-Swift.h"
#else
    #import "<moduleName>-Swift.h"
#endif
Matt
  • 4,261
  • 4
  • 39
  • 60
0

You change the value SWIFT_OBJC_INTERFACE_HEADER_NAME ('Objective-C Generated Interface Header Name') in Build Settings so that you have the same header file name for both targets.

mcfedr
  • 7,845
  • 3
  • 31
  • 27