react-native-text-detector icon indicating copy to clipboard operation
react-native-text-detector copied to clipboard

Tesseract branch: App crashes on using RNTextDetector.detect

Open IElgohary opened this issue 5 years ago • 4 comments

I'm trying the tesseract branch on android using the example given in the Readme but the app crashes as soon as the detect method is called. The app crashes without giving any error message and running 'react-native log-android' shows nothing either.

IElgohary avatar Jul 12 '19 18:07 IElgohary

I'm having the same issue; seems to have something to do with accessing the tessdata files. You can see the native crash messages by running in Android Studio.

E/RNTextDetector: ERROR: Creation of directory /storage/emulated/0/com.myapp/tessdata failed, check permission to write to external storage.
E/RNTextDetector: Unable to copy files to tessdata java.io.FileNotFoundException: /storage/emulated/0/com.myapp/tessdata/eng.traineddata: open failed: ENOENT (No such file or directory)

I do have the file at android/app/src/main/assets/tessdata/eng.traineddata as per the README, hm...

ghost avatar Sep 15 '19 14:09 ghost

In Android Folder, open AndroidManifest file and add android:requestLegacyExternalStorage

<manifest ... > <application android:requestLegacyExternalStorage="true" ... >

ajenkuhnabat avatar Oct 21 '20 14:10 ajenkuhnabat

Did you guys get any solution? ? i am facing same issue. @ajemkuhnabat i tried your solution but did not work.

mohity777 avatar Nov 23 '20 15:11 mohity777

Any update on this? I am still facing this problem too

thanhluantl2304 avatar Nov 12 '21 09:11 thanhluantl2304