我需要发布一个启用了位码(bitcode)的框架,但这却很麻烦。我在项目设置中将“启用位码(Enable Bitcode)”设置为“是(YES)”,并且它可以干净地构建出真实设备和模拟器的版本。
我想测试这个库,所以将其集成到一个新的应用程序中进行测试,但现在只能在模拟器上构建。当我尝试构建真实设备版本时,会出现以下错误:
ld: '/path/to/Framework.framework/Company(File.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
就像我说的那样,我已经启用了Bitcode来构建它,所以我不确定为什么会发生这种情况。
有任何想法吗?谢谢
__LLVM
段的存在并不意味着 Bitcode 也存在。还有其他名为__LLVM
的段,但它们不包含 Bitcode。最好用__bitcode
进行 grep(搜索)。 - MeckiOTHER_CFLAGS="-fembed-bitcode"
并更新嵌入式二进制文件后,最终的应用程序归档构建才成功。然而,otool 没有显示segname __LLVM
中的任何更改,而且根本没有出现bitcode
。唯一表明库具有位码的迹象是它们的大小从不到 1MB 增加到 9MB。 - JustAMartin