I have been trying to build a framework in such a way that it will work for tvOS, but am continually confronted with the error message when publishing to the actual device (the simulator produces a similar warning):
ld: in<path>/ios/framework/boost.framework/boost(thread_thread.o), building for tvOS, but linking in object file built for iOS, for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
These are the various build settings I know need to happen:
- bitcode enabled (adding ' -fembed-bitcode' to build commands)
- correct architectures (arm64 for the new apple tv, x86_64 for the simulator)
- using the correct xcrun command for tvos ('xcrun --sdk appletvos' and 'xcrun --sdk appletvsimulator')
- pointing to the correct SDKs (/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer and /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer)
My question is, what are the various things that clang and ld are looking for before throwing the above error on a framework when building for tvOS?
Is there any way to troubleshoot why a framework wouldn't be working on tvOS? (like using 'dwarfdump'?)
An example of a working build process for any framework to tvOS would be a great help... thanks!