I working on building build an App that uses the camera to capture the image and using tesseract perform OCR?
I am getting path error for Tesseract
Hi @kyadakru
You should provide more info about what you’ve tried and the exact error message. But basically, Tesseract is native code, so you will either need to eject, or else you will need to use EAS Build. It is not possible to use Tesseract in the Expo Go app or in an app that you build using expo build
.
Note: If you use EAS Build, you can build on your own machine as long as you have Android Studio (for Android apps) and Xcode (for iOS apps) installed. This is free. Otherwise, you can sign up for Expo’s “priority” plan and use their build servers to build the app. Also, the Expo team said that they are planning to have a free tier for the EAS Build build service, similar to what they have for the “classic” expo build
build service.
I did get react-native-tesseract-ocr
working with a patch. (I only tried it on Android so far). I haven’t looked at this code in a couple of months, so I’ve only just remembered the patch. I think that might be what you’re actually looking for. Have a look at my code here. The patch is in the patches
directory, and I use patch-package
to apply it.
You might also want to try using react-native-vision-camera
’s Frame Processors along with Tesseract.
Hello @wodin ,
I was trying out your code, I am getting the following error.
null is not an object (evaluating ‘_reactNativeTesseractOcr.default.recognize’)
at App.js:68:35 in recognizeTextFromImage
at App.js:63:33 in recognizeTextFromImage
at App.js:93:36 in Button.props.onPress
at node_modules/react-native/Libraries/Pressability/Pressability.js:691:17 in _performTransitionSideEffects
at node_modules/react-native/Libraries/Pressability/Pressability.js:628:6 in _receiveSignal
at node_modules/react-native/Libraries/Pressability/Pressability.js:524:8 in responderEventHandlers.onResponderRelease
Can you provide steps on how to get it running?
Also, can you provide steps on how to get it running by eject or EAS build?
I am new to both react native and Expo if you can provide a little insight on how to get tesseract running on expo .
Thanks
Did you build with eas build
?
If you provide steps that will be great.
When I am doing EAS build I am getting stuck on the git commit step
Can you please refer to the below message and guide me.
$ eas build
★ eas-cli@0.33.0 is now available, please upgrade.
Proceeding with outdated version
Select platform › All
Warning! Your repository working tree is dirty.
This operation needs to be run on a clean working tree, please commit all your changes before proceeding.
Commit changes to git? … yes
Commit message: … Initial Commit
Error: git exited with non-zero code: 128
is your git client configured? what happens if you run git commit
in the repo?
I think there are two possibilities.
- You haven’t told Git your name and e-mail address. Recent versions of Git are picky about that sort of thing.
- Maybe you have some files in your project owned by
root
and now Git can’t write to certain files.
I think the first possibility is more likely. If so, if you run git commit
from the command line it should tell you how to set your name and e-mail address.