Comments (7)
After spending two days debugging react-native-permissions
, I found the issue is with react-native-qrcode-scanner
.
It has "react-native-permissions": "^2.0.2"
in it's dependencies but the current version is "react-native-permissions": "^3.8.0"
.
This version of react-native-permissions (3.8.0)
has breaking changes.
Quick fix
- Install
react-native-permissions
. - Most importantly, remember to add
"reactNativePermissionsIOS": ["Camera"]
and"postinstall": "react-native setup-ios-permissions && pod-install"
to yourpackage.json
. - Run
npm install
. - Delete
node_modules/react-native-qrcode-scanner/node_modules/react-native-permissions
because it installs the deprecated2.0.2
. (You'll need to do this each time you clear your node_modules). - Your QR code scanner should be working again 🥳.
The postinstall
goes in the scripts
section of your package.json
.
You'll also need "pod-install": "0.1.38"
.
If you still have issues, delete your node_modules
, package.lock
and run pod deintegrate
. Then retry the steps.
PR Options
I can create a PR to fix this issue. We have two options:
- Take out the
react-native-permissions
dependency and update the readMe so everyone knows to install the dependency themselves and set it up properly. - Update the dependency and add the necessary steps. (
reactNativePermissionsIOS
andpostinstall
).
Please react with 👍
for option 1 and 🚀
for option 2.
from react-native-qrcode-scanner.
Seem to have this error even after following the above steps on ios
duplicate symbol 'OBJC_CLASS$_RNPermissionHandlerCamera' in
libPermission-Camera.a(RNPermissionHandlerCamera.o)
libRNPermissions.a(RNPermissionHandlerCamera.o)❌ duplicate symbol 'OBJC_METACLASS$_RNPermissionHandlerCamera' in
libPermission-Camera.a(RNPermissionHandlerCamera.o)
libRNPermissions.a(RNPermissionHandlerCamera.o)❌ ld: 2 duplicate symbols for architecture x86_64
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
Did you take out the prior react-native-permissions
installation steps from your podfile
?
In the past, you had to add the pods being used by react-native-permissions
to your podfile
. That's no longer needed.
from react-native-qrcode-scanner.
@stanjhae Option 1 is better since reactNativePermissionsIOS
should be in user project package.json
, couldn't be set in the library package.json
.
The proper way to do it is to update this lib package.json
like this:
"peerDependencies": {
"react-native-permissions": "the-minimal-version-you-want-to-use"
},
"peerDependenciesMeta": {
"react-native-permissions": {
"optional": true
}
}
from react-native-qrcode-scanner.
try this one:
react-native-permissions
You will also need to install react-native-permissions to handle camera related permissions
npm install react-native-permissions --save
react-native link react-native-permissions
For iOS, as part of the react-native-permissions setup you will need to add the following code to your Podfile
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
You may also need to reset your simulator data after adding those permissions Device -> Erase All Content and Settings...
from react-native-qrcode-scanner.
This will help you https://www.youtube.com/watch?v=sE0MEyFA7E4&list=PLQhQEGkwKZUrempLnmxjt7ZCZJu1W3p2i&index=10
from react-native-qrcode-scanner.
Seem to have this error even after following the above steps on ios
duplicate symbol 'OBJC_CLASS$_RNPermissionHandlerCamera' in
libPermission-Camera.a(RNPermissionHandlerCamera.o)
libRNPermissions.a(RNPermissionHandlerCamera.o)
❌ duplicate symbol 'OBJC_METACLASS$_RNPermissionHandlerCamera' in
libPermission-Camera.a(RNPermissionHandlerCamera.o)
libRNPermissions.a(RNPermissionHandlerCamera.o)
❌ ld: 2 duplicate symbols for architecture x86_64
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
from react-native-qrcode-scanner.
Seem to have this error even after following the above steps on ios
duplicate symbol 'OBJC_CLASS$_RNPermissionHandlerCamera' inlibPermission-Camera.a(RNPermissionHandlerCamera.o)
libRNPermissions.a(RNPermissionHandlerCamera.o)❌ duplicate symbol 'OBJC_METACLASS$_RNPermissionHandlerCamera' in
libPermission-Camera.a(RNPermissionHandlerCamera.o)
libRNPermissions.a(RNPermissionHandlerCamera.o)❌ ld: 2 duplicate symbols for architecture x86_64
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)Did you take out the prior
react-native-permissions
installation steps from yourpodfile
?In the past, you had to add the pods being used by
react-native-permissions
to yourpodfile
. That's no longer needed.
i face same issue, follow your instruction, everything works now. You save my day, bro
from react-native-qrcode-scanner.
Related Issues (20)
- Incompability when using react-native-permissions 2.0.2 (from this package) and in parallel with react-native-permissions 3.6.0 HOT 1
- Check if user has denied or accepted camera permission in real time
- this lib is dead? HOT 1
- Keeps adding extra digit to Start/End of actual barcode if it's less than 13 numbers HOT 2
- Kindly Remove/Archive this package.
- Unable to use QRCodeScanner HOT 9
- Invariant Violation: View config getter callback for component `AndroidProgressBar` must be a function (received `undefined`).
- After react native 0.70 upgrade, It crashes. HOT 3
- can't scan HOT 1
- scan HOT 1
- How to re request permission? HOT 1
- repeat scan HOT 1
- [Release] App Show White Screen HOT 2
- ViewPropTypes is back on React Native 0.71 HOT 7
- Keeps repeating scanning same qr code multiple times HOT 3
- sensitive is low for catch barcode HOT 4
- How can I user proguard-rules in it.
- react-native-permissions: NativeModule.RNPermissions is null HOT 6
- what can i do if i'm use only barcode scanner instead of QR code scanner
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-qrcode-scanner.