zsajjad / react-native-text-detector

Text Detector from image for react native using firebase MLKit on android and Tesseract on iOS
MIT License
221 stars 60 forks source link

Tesseract branch: App crashes on using RNTextDetector.detect #23

Open IElgohary opened 5 years ago

IElgohary commented 5 years ago

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.

ghost commented 5 years ago

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...

anjenkuhn commented 4 years ago

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

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

mohity777 commented 3 years ago

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

thanhluantl2304 commented 2 years ago

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