react-native-tesseract-ocr: Error : Data path does not exist

What this can happened ?

this is my code

takePicture = async function() { if (this.camera) { const options = { quality: 0.5, base64: true }; const data = await this.camera.takePictureAsync(options) console.log(data.uri); this.setState({path: data.uri}); const tessOptions = { whitelist: null, blacklist: '1234567890\'!"#$%&/()={}[]+*-_:;<>' }; RNTesseractOcr.recognize(data.uri, 'LANG_ENGLISH', tessOptions) .then((result) => { // this.setState({ ocrResult: result }); console.log("OCR Result: ", result); }) .catch((err) => { console.log("OCR Error: ", err); }) .done(); } };

this is the error

OCR Error: Error: Data path does not exist! at createErrorFromErrorData (D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:121) at D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:78 at MessageQueue.__invokeCallback (D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:398) at D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:137 at MessageQueue.__guardSafe (D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314) at MessageQueue.invokeCallbackAndReturnFlushedQueue (D:\React Native\alternote\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:136) at debuggerWorker.js:70

i put my tess data in src/main/assets/tessdata but not working

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 18 (2 by maintainers)

Most upvoted comments

same here ! +1

Still no idea why this is happening?

@Altercode99 @nasir03082409229 @dass2808 could you please provide the name and the version of the library that you’re using to take the picture?

I ran into this, Solution: Give your installed app the storage write permission either directly into your emulator/phone app’s permission manager or throughout gradle/app intents.

EDIT: To do it using your react app’s xml manifest, simply follow this.