Xcode cannot find auto-generated swift header moduleName-Swift.h in pch file in duplicate

I duplicated the target and got the following build error:

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

      

I don't see any difference between the two targets that might cause this issue.

Any ideas why this is happening?

+3


source to share


2 answers


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

.

I had to add the C flag to the duplicate target and use it in Prefix.pch

. (Custom setting is not displayed when pch file is analyzed.)



enter image description here

#ifdef DEVLOPMENT_SERVER
    #import "<duplicateModuleName>-Swift.h"
#else
    #import "<moduleName>-Swift.h"
#endif

      

+1


source


You change the value SWIFT_OBJC_INTERFACE_HEADER_NAME

('Objective-C Generated Interface Header Name') in your build settings to have the same header name for both purposes.



0


source







All Articles