Inavlid 反应本机权限 ios.PERMISSION.CAMERA

ane*_*kix 4 react-native react-native-ios react-native-permissions

我正在使用react-native-qr-code-scanner在我的应用程序中添加 QR 扫描仪功能。我遵循了所有的 instaruction 并且在 android 上一切正常,但是当我在 ios 上构建我的应用程序时,应用程序无法找到该RNPermissions库,因此我按照自述文件中的建议手动链接它。链接错误现在消失了,我得到了 Invali RMPermission ios.PERMISSION.CAMERA should be one of()。该错误在react-native-permissions README PAGE的 github 页面和解决它的步骤中有所描述。它说

检查您是否链接了至少一个权限处理程序。

我无法将那里描述的权限处理程序添加到 Podfile,因为它会React(0.11.0)自动安装版本(但这不是必需的),因为我已经有了最新的反应。解决这个问题的方法是什么?

[!]

pod install添加后运行时

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
Run Code Online (Sandbox Code Playgroud)

我明白了

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.
Run Code Online (Sandbox Code Playgroud)

Tom*_*ong 5

我也遇到了这个问题ios.PERMISSION.CAMERA should be one of(),在 podfile 中使用以下命令将解决您的问题。

  pod 'RNPermissions', :path => '../node_modules/react-native-permissions'
  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
Run Code Online (Sandbox Code Playgroud)