Open kevinmlong opened 7 years ago
@gali8 @kevincon - still seeing this issue. Any advise you may have would be great! Also - any thoughts on making the framework available via providing the binary in the release for Carthage users?
For those who are interested I was able to figure out the following with some help from here https://dzone.com/articles/creating-a-universal-framework-in-xcode-9.
In a root directory create a script (e.g. create-tesseract-universal-framework.sh). The contents of the script is:
git clone https://github.com/gali8/Tesseract-OCR-iOS.git
rm -Rf Tesseract-OCR-iOS/build
xcodebuild archive -project Tesseract-OCR-iOS/Tesseract\ OCR\ iOS.xcodeproj -scheme TesseractOCR -sdk iphoneos SYMROOT=build
xcodebuild build -project Tesseract-OCR-iOS/Tesseract\ OCR\ iOS.xcodeproj -target TesseractOCR -sdk iphonesimulator SYMROOT=build
cp -RL Tesseract-OCR-iOS/build/Release-iphoneos Tesseract-OCR-iOS/build/Release-universal/
cp -RL Tesseract-OCR-iOS/build/Release-iphonesimulator Tesseract-OCR-iOS/build/Release-universal/
lipo -create Tesseract-OCR-iOS/build/Release-iphoneos/TesseractOCR.framework/TesseractOCR Tesseract-OCR-iOS/build/Release-iphonesimulator/TesseractOCR.framework/TesseractOCR -output Tesseract-OCR-iOS/build/Release-universal/TesseractOCR.framework/TesseractOCR
cp -r Tesseract-OCR-iOS/build/Release-universal/TesseractOCR.framework .
After running the script, there will be a TesseractOCR.framework in the directory. Drag this framework into your project. This will allow the project to compile for either a device or a simulator.
@klongmitre you are a lifesaver!!
This helped me a lot!
For those who are interested I was able to figure out the following with some help from here https://dzone.com/articles/creating-a-universal-framework-in-xcode-9.
In a root directory create a script (e.g. create-tesseract-universal-framework.sh). The contents of the script is:
git clone https://github.com/gali8/Tesseract-OCR-iOS.git rm -Rf Tesseract-OCR-iOS/build xcodebuild archive -project Tesseract-OCR-iOS/Tesseract\ OCR\ iOS.xcodeproj -scheme TesseractOCR -sdk iphoneos SYMROOT=build xcodebuild build -project Tesseract-OCR-iOS/Tesseract\ OCR\ iOS.xcodeproj -target TesseractOCR -sdk iphonesimulator SYMROOT=build cp -RL Tesseract-OCR-iOS/build/Release-iphoneos Tesseract-OCR-iOS/build/Release-universal/ cp -RL Tesseract-OCR-iOS/build/Release-iphonesimulator Tesseract-OCR-iOS/build/Release-universal/ lipo -create Tesseract-OCR-iOS/build/Release-iphoneos/TesseractOCR.framework/TesseractOCR Tesseract-OCR-iOS/build/Release-iphonesimulator/TesseractOCR.framework/TesseractOCR -output Tesseract-OCR-iOS/build/Release-universal/TesseractOCR.framework/TesseractOCR cp -r Tesseract-OCR-iOS/build/Release-universal/TesseractOCR.framework .
After running the script, there will be a TesseractOCR.framework in the directory. Drag this framework into your project. This will allow the project to compile for either a device or a simulator.
There is a way to build with "GENERATE_MASTER_OBJECT_FILE = YES" without setting the flag manually in Xcode, for example adding some options to build command in the script
I'm having some trouble with getting Tesseract appropriately working sans cocoa pods.
The project works fine when I build and run on a real device. Building and running on a simulator device however results in a Linker Error
In the log it shows:
Any guidance in resolving this would be greatly appreciated.
Thanks!