Error associating iOS static infrastructure with target applications and XCTest

I have an application with Objective-C and Swift combined. It has an XCTest goal. I have a static structure written in Objective-C, which is connected to the main target and is used by the main goal and the purpose of testing.

I tested 3 different cases in which two of them compile, but with warnings, while I do not see any warnings when performing my tests:

1) The static structure is not connected to the test target (via Link Binary With Libraries ), but is included in the test target of the Framework search paths . The test target compiles, but I have a warning:

 ld: warning: Auto-Linking supplied '.../MyStaticFramework/MyStaticFramework.framework/MyStaticFramework', framework linker option at /.../MyStaticFramework/MyStaticFramework.framework/MyStaticFramework is not a dylib 

2) The static structure is tied to the test target (via Link Binary With Libraries ) and is included in the test target of the Framework search paths . The test target compiles, but I have a warning:

 objc[2653]: Class MyStaticFrameworkClassA is implemented in both /.../MyApp.app/MyApp and /.../MyApp.app/PlugIns/Tests.xctest/Tests. One of the two will be used. Which one is undefined. 

3) The static structure is not connected to the test target (via Link Binary With Libraries ) and is not included in the test target of the Framework search paths . Target does not compile:

 In file included from ".../Tests/.../TestFile.m:13: .../Build/Intermediates/MyApp.build/Debug-iphonesimulator/Tests.build/../MyApp.build/DerivedSources/MyApp-Swift.h:103:9: fatal error: module 'MyStaticFramework' not found @import MyStaticFramework; ^~~~~~~~ 
+1
source share

All Articles