Open BajajSaajan opened 1 year ago
Also getting this error.
react-native-permissions is set up correctly. I use them in the same project and everything is ok.
@mmvlad I tried. as per the documentation npm install react-native-permissions --save react-native link react-native-permissions
Is there anything i am missing?
One of the typical solutions for such a case is to override dependencies. Override the react-native-permissions dependency for react-native-qrcode-scanner. For npm we need to use overrides, and for resolutions for yarn.
So for this code works just delete node_modules folder, yarn.lock file, and add this code to package.json
"resolutions": {
"react-native-permissions": "^3.8.0"
},
"overrides": {
"react-native-qrcode-scanner": {
"react-native-permissions": "^3.8.0"
}
},
I'm still having this issue. I tried deleting the react-native-qrcode-scanner\node_modules folder
,. Then added the code above to the package.json
file of my app. This however then gives me RNPermissionsModule' could not be found.
And I have also been getting Invariant Violation: "main" has not been registered
.
Just upgrade your "react-native-permissions" library to "3.6.0", and the issue will removed. I was facing this with my Camera and "react-native-qrcode-scanner" lib.Thanks
The solution provided by @zakharov-dy worked for me. I love react-native-qrcode-scanner. This issue is annoying, it took me an hour to find this solution, so dear @moaazsidat if you could fix this, it would be great and probably help many people! Thank you!
I want to integrate this package only in android. While integration i am getting this error as below, kindly assist.
If you are using CocoaPods on iOS, run
pod install
in theios
directory and then clean, rebuild and re-run the app. You may also need to re-open Xcode to get the new pods. • If you are getting this error while unit testing you need to mock the native module. You can use this to get started: https://github.com/react-native-community/react-native-permissions/blob/master/mock.js