My project contains two targets, the main application and a separate target for testing. The main target builds no problem but the test target fails with the following linker warning:
"ld: warning: ignoring file .../libj2objc_main.a, file was built for archive which is not the architecture being linked (i386)"
It seems like this is a common problem, and there are several posts that deal with solutions, from setting the "Build Active Architectures Only" flag to No (or is it Yes?) to using shell scripts to force Xcode to build a fat binary. (Using lipo
I've confirmed that the compiled .a file only contains the x86_64 binary.) It's really bizarre that when I create a new test target and run the default XCTest suite everything builds fine, but if I attempt to add the Pods config file to the test target in Info -> Configurations and run the tests again everything blows up. This has never been a problem in other projects.
My question is why is this only failing for the test target? I'm using the same architecture in both the regular and test builds, so why is the .a
only being a problem in the latter case?