我正在使用反应-本机-qr-代码-扫描器在我的应用程序中添加QR扫描仪功能。我跟踪了所有的instaruction & android上一切都很好,但是当我在ios应用上构建我的应用程序时,无法找到RNPermissions
库,所以我按自述的方式手动链接了它。链接错误现在消失了,我得到了Invali RMPermission ios.PERMISSION.CAMERA should be one of()
。在反应-本机权限自述页面的github页面上描述了错误&解决该错误的步骤。上面写着
检查是否链接了至少一个权限处理程序。
我不能像在Podfile中描述的那样添加权限处理程序,因为它自动安装React(0.11.0)
版本(但这不是必需的),因为我已经有了最新的响应。解决这个问题的方法是什么?
好了!
当我在添加pod install
之后运行
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
我得到
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.
发布于 2019-12-12 08:26:38
我也得到了问题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"
发布于 2019-12-24 07:07:35
我的解决方案是在podfile中执行以下更改:
添加:modular_header => false
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false
增加使用相机进行qrcode扫描的权限:
pod 'Permission-Camera', :path => "../node_modules/react-native-permissions/ios/Camera.podspec"
希望这能帮上忙!
发布于 2021-06-02 17:07:39
重复检查文件路径,应该是“/Camera.podspec”。
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'RNPermissions', :path => '../node_modules/react-native-permissions'
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone/Permission-Microphone.podspec"
pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec"
https://stackoverflow.com/questions/59090141
复制相似问题