Andrew Ebling
Andrew Ebling

Reputation: 10283

Test target can't find app's Objective-C Generated Interface Header

I have an app target which includes a mix of Objective-C and Swift code. The Swift code uses Objective-C code and vice versa.

The app target is compiling fine, but when I try and compile my test target, it can’t find the “Objective-C Generated Interface Header”. Although the app target compiles fine, when it comes to compiling the app source code in the test target, the #import “MyApp-Swift.h” file results in a “file not found” error from the compiler.

If I check in the DerivedData folder, I can see the MyApp-Swift.h file inside the DerivedSources folder for the app MyApp.build folder, but not for Tests.build (which has no DerivedSources folder).

Does anyone know how to resolve this issue please?

Upvotes: 0

Views: 341

Answers (1)

Andrew Ebling
Andrew Ebling

Reputation: 10283

Ensure that the app source files are only included in the app target and not in the test target as well.

Although it used to be necessary to include the app source in both the app and test targets, this is no longer the case.

Upvotes: 0

Related Questions