Inavlid react Native permission ios.PERMISSION.CAMERA

anekix picture anekix · Nov 28, 2019 · Viewed 8.5k times · Source

I am using react-native-qr-code-scanner to add QR scanner functionality in my app. I followed all the instaruction ther & everything works fine on android but when i build my app on ios app is not able to find the RNPermissions library so i manually linked it as suggested on it README. Linked error is now gone and i am getting Invali RMPermission ios.PERMISSION.CAMERA should be one of(). The error is described on the github page of react-native-permissions README PAGE & steps to solve it. it says

Check that you linked at least one permission handler.

I cannot add permission handler as described there to Podfile as it aslo installs the React(0.11.0) verison automatically (but this is not required ) as i already have newest react. what is the way to solve this?

[!]

When i run pod install after adding

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"

i get

Unable to find a specification for `RNPermissions` depended upon by `Permission-Camera`

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Answer

TommyLeong picture TommyLeong · Dec 12, 2019

I've gotten the issue ios.PERMISSION.CAMERA should be one of() as well, use the following command in podfile will solve your issue.

  pod 'RNPermissions', :path => '../node_modules/react-native-permissions'
  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"