版本: 第四代4.0.0 CocoaPods 1.2.1
当我在模拟器上构建时 - 一切都很好,但是当我试图在我的iPhone上构建时,xCode给了我下一个警告:
Warning: Multiple build commands for output file /Users/Username/Library/Developer/Xcode/DerivedData/ProjectName-hjheurpncvhpfbabezufoumrybad/Build/Products/Debug-iphoneos/TesseractOCRiOS/TesseractOCR.framework/PrivateHeaders/config_auto.h
最近面临同样的问题,绝对不是最好的,但可接受的解决方法 - 只需在“Build Phases”中删除路径为“./Pods/TesseractOCRiOS/TesseractOCR/include/leptonica/”的重复行“config_auto.h”之一 - “标题” - TesseractOCRiOS目标的“私人”设置。
OCR识别功能不受此更改的影响。
有关详细信息,请参阅screenshot。
如果您正在使用cocoapods,则可以在pod文件的末尾添加以下脚本:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'TesseractOCRiOS'
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
header_phase = target.build_phases().select do |phase|
phase.is_a? Xcodeproj::Project::PBXHeadersBuildPhase
end.first
duplicated_header_files = header_phase.files.select do |file|
file.display_name == 'config_auto.h'
end
duplicated_header_files.each do |file|
header_phase.remove_build_file file
end
end
end
end
刚注意到它也禁用了bitcode。如果那不是您需要的,请将其删除。该脚本删除重复的头文件,因为它们仅在私有部分下。