gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Can‘t compile on device #293

Closed mpmX closed 8 years ago

mpmX commented 8 years ago

Hi, I have problems compiling my Swift project using Tesseract-OCR-iOS.

My environment: XCode 7.3.1 Swift 2.2 Target iOS version: 9.3 Tesseract-OCR-iOS version 4.0.0 from CocoaPods

I did the following:

# Uncomment this line to define a global platform for your project
platform :ios, '9.3'
target 'OCR' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'TesseractOCRiOS', '4.0.0'
end

It says that I shoudl disable bitcode, however, changing bitcode to no does not make any difference.

Can someone help please?

sdost commented 8 years ago

You need to also disable bitcode on the Pod target. The easiest way to do that is to add this to your Podfile:

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
mpmX commented 8 years ago

Thanks, I also found this solution. It works!