-
-
Notifications
You must be signed in to change notification settings - Fork 840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission-Camera - Definition of 'RNPermissionHandlerCamera' must be imported from module 'RNPermissions.RNPermissionHandlerCamera' before it is required #765
Comments
Don't link the handler twice. Here you're installing it using Podfile (legacy method) AND package.json (new method). Remove it from your Podfile: - permissions_path = '../node_modules/react-native-permissions/ios'
- pod 'Permission-Camera', :path => "#{permissions_path}/Camera" See https://github.com/zoontek/react-native-permissions/releases/tag/3.7.0 |
but this time "cannot read property 'request' of undefined" error :/ ` import axios from 'axios' import QRCodeScanner from 'react-native-qrcode-scanner' const QRScreen = ({ navigation, route }) => {
} export default QRScreen |
` ERROR TypeError: Cannot read property 'request' of undefined This error is located at: This error is located at: |
@ahmetcangurel having the same issue. In any case those are the missing steps:
or use
As mentioned that still brings me to the same results but maybe help someone for some other issue RN: v0.71.7 @zoontek cleaning does not solve this one SOLVED: Was managed to solve this. Not related directly to So to solve it temporary, you can force
Then remove |
Bug summary
Hi, i m trying setup react-native-qrcode-scanner.
podfile:
`
target 'some' do
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
config = use_native_modules!
Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
`
info.plist
<key>NSCameraUsageDescription</key> <string>$(PRODUCT_NAME) needs access to your camera</string> <key>NSMicrophoneUsageDescription</key> <string>$(PRODUCT_NAME) needs access to your Microphone.</string> <key>NSPhotoLibraryUsageDescription</key> <string>$(PRODUCT_NAME) needs access to your photo library</string>
package.json
`
{
"name": "some",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest",
"postinstall": "react-native setup-ios-permissions && pod-install",
"svgr": "svgr ./src/Assets/icons -d ./src/Components/icons --native --icon --svg-props fill=currentColor,width={props.size},height={props.size}"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.12",
"@react-native-firebase/app": "^17.4.0",
"@react-native-firebase/auth": "^17.4.0",
"@react-native-firebase/messaging": "^17.4.1",
"@react-navigation/bottom-tabs": "^6.5.7",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"axios": "^1.3.4",
"deprecated-react-native-prop-types": "^4.0.0",
"firebase": "^9.18.0",
"lottie-react-native": "^5.1.5",
"react": "18.2.0",
"react-native": "^0.71.6",
"react-native-camera": "^4.2.1",
"react-native-controlled-mentions": "^2.2.5",
"react-native-device-info": "^10.6.0",
"react-native-gesture-bottom-sheet": "^1.1.0",
"react-native-gesture-handler": "^2.9.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-permissions": "^3.8.0",
"react-native-qrcode-scanner": "^1.5.5",
"react-native-safe-area-context": "^4.5.0",
"react-native-screens": "^3.20.0",
"react-native-select-dropdown": "^3.3.2",
"react-native-svg": "^13.9.0",
"react-native-vector-icons": "^9.2.0",
"react-redux": "^8.0.5",
"redux": "^4.2.1"
},
"reactNativePermissionsIOS": [
"AppTrackingTransparency",
"BluetoothPeripheral",
"Calendars",
"Camera",
"Contacts",
"FaceID",
"LocationAccuracy",
"LocationAlways",
"LocationWhenInUse",
"MediaLibrary",
"Microphone",
"Motion",
"Notifications",
"PhotoLibrary",
"PhotoLibraryAddOnly",
"Reminders",
"Siri",
"SpeechRecognition",
"StoreKit"
],
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.21.0",
"@react-native-community/eslint-config": "^3.2.0",
"@svgr/cli": "^6.5.1",
"@svgr/core": "^6.5.1",
"@tsconfig/react-native": "^2.0.2",
"@types/jest": "^29.2.1",
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.73.8",
"pod-install": "^0.1.38",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
},
"jest": {
"preset": "react-native"
}
}
`
use
<QRCodeScanner onRead={(e) => selectFunction(e)} reactivate={true} reactivateTimeout={3000} showMarker={true} markerStyle={{ borderColor: Colors.primary }} />
Library version
3.8.0
Environment info
Steps to reproduce
Reproducible sample code
The text was updated successfully, but these errors were encountered: