react-native-document-scanner: error: cannot find symbol import org.opencv.DocumentScannerPackage
This is my package.json file
{
"name": "TestApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.6.3",
"react-native": "0.57.8",
"react-native-document-scanner": "git+https://github.com/Michaelvilleneuve/react-native-document-scanner.git#android"
},
"devDependencies": {
"babel-jest": "24.8.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
Was struggling for past 2 days… unable to get any solutions… I just installed using android branch and trying it in android mobile.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 18 (2 by maintainers)
The automatic linking seems to have failed retrieving the package name. The import line should look like this :
import com.documentscanner.DocumentScannerPackage
It is work to add react-native.config.js with below image content in this project root dir! I have tested it
Looks like this is an issue with React Native’s 60+ auto-linking. It looks like this, along with andreluisjunqueira/react-native-documentscanner-android need to be linked manually, following the instructions described in Junqueira’s readme.
To prevent auto-linking, create a file (if it doesn’t already exist) called “react-native-config.js” and add the following:
The best thing to do, would be to actually look at the files involved in auto-linking and see if we can’t update them to get things to work with React-Native 60+
Hi everyone, has anyone managed to make react-native-document-scanner work with react native 0.60.x on both platforms? I succeeded on iOS but on Android even after having disabled auto linking, the only thing obtained is a black screen. If someone did it, or met the same issues and passed, could he let me know how?
Hi @Sride, did you get react-native-document-scanner to work with zahidahmed024’s suggestion?
Thank you in advance
Same problem goes for me…
Hey @ceyhuncfc9 Linking opencv is the problem, refer this Michaelvilleneuve/react-native-perspective-image-cropper#26 in this we have linked opencv.
@Michaelvilleneuve Yes it is…
@Michaelvilleneuve thanks for the response, you saved my day, after changing this line, the app shows blank white page. the app.js has only DocumentScanner
Here is the changed line.