iOS -weak_library和-bitcode_bundle(Xcode设置ENABLE_BITCODE = YES)不能一起使用

时间:2018-08-09 04:21:32

标签: ios swift tesseract

我想在项目中使用Tesseract。我创建了一个新项目,将Tesseract添加到了我的pod文件中。 pod正确安装,我的项目在Emulator设备上完美构建。但是在真实设备上发生了以下错误。不知道发生了什么 ld:-weak_library和-bitcode_bundle(Xcode设置ENABLE_BITCODE = YES)不能一起使用 铛:错误:链接器命令失败,退出代码为1(使用-v查看调用)

1 个答案:

答案 0 :(得分:1)

问题原因::在安装使用cocoapod编译的ENABLED_BITCODE = YES依赖项时,它会覆盖此设置,从而造成问题。为了解决这个问题,我们必须在cocoapod上添加这些行,以便在安装cocoapod依赖项期间不会覆盖ENABLED_BITCODE设置

 post_install do |installer|
     installer.pods_project.targets.each do |target|
         target.build_configurations.each do |config|
             config.build_settings['ENABLE_BITCODE'] = 'NO'
         end
     end
 end