2
votes

I used CocoaPods to integrate Tesseract-OCR-iOS with my existing Xcode (version 7.2) project (Swift 2) according to the instructions on https://github.com/gali8/Tesseract-OCR-iOS. After editing the Podfile and running

pod install

I closed the xcodeproj and opened up the xcworkspace file. Whenever I run my application, I get two warnings consistently.

The first warning is:

Auto property synthesis will not synthesize property 'completion Block'; it will be implemented by its superclass, use @dynamyic to acknowledge intention.

The second warning is:

Warning: Multiple build commands for output file /Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/TesseractOCR.framework/PrivateHeaders/config_auto.h

These two warnings show up whether I run the application on my iPhone 6+ (iOS 9.2) or on the simulator.

The application builds and runs on my simulator, but when I try to run it on my actual device, I get an error and the build fails. The error is:

ld: -weak_library and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Once again, the application builds and runs on the simulator but not on the actual device. I'd like to fix both warnings and the error, but my top priority is the error.

Thanks for your help.

1
set ENABLE_BITCODE=NO at build settingsErmal Kaleci
I already did, but the error still persists.Morgoth
did you do it to all targets?Ermal Kaleci
Oh man, it turned out that in the pods project, there were multiple targets that I didn't do it to. I changed it and now it works. Thank you so much for your help.Morgoth
@Morgoth This works for me. Thanks.tomfriwel

1 Answers

3
votes

Even I had this problem while installing TessaractOCR for iOS, using pod 'TesseractOCRiOS', '4.0.0'. After several try I found the solution.

Just follow the following steps as follow.

  1. Go to target-> Build Settings -> Enable Bitcode as "NO". Enable bitcode for target

  2. Now Select Project on the left side, and set Enable bitcode as "NO". Enable bitcode for project

  3. Now select the Pods.xcodeproj and set Enable bitcode as "NO". Enable bitcode for Pods

  4. Final Step, Select each Target files of Pods.xcodeproj and set Enable bitcode as "NO" for all targets. Enable bitcode for Pods Target Now Clean and build project.