我想在我的项目中使用Tesseract
。我已经创建了一个新项目,并将Tesseract
添加到pod文件中。pod安装正确,我的项目完全建立在模拟器设备上。但在实际设备上发生了以下错误。不知道怎么回事
ld:-弱库和-位代码包(Xcode设置ENABLE\u bitcode=YES)不能一起使用
错误:链接命令在退出代码1失败(使用-V以查看调用)
最佳答案
问题原因:在安装用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