我实现了react-native-qrcode-scanner,在android上运行良好。但 iOS 上有问题。 “反应本机”:“0.73.6”, "react-native-qrcode-scanner": "^1.5.5", “反应本机权限”:“^4.1.5”,
我的 podFile 是 权限路径 = '../node_modules/react-native-permissions/ios' pod '权限相机', :path => "#{permissions_path}/Camera" 我也尝试过 权限路径 = '../node_modules/react-native-permissions/ios' pod '权限相机', :path => "#{permissions_path}/Camera.podspec"
但是出现错误。 [在此输入图片描述](https://i.sstatic.net/ORMFf318.png)
请给我如何在 IOS 上反应本机qrcode-scanner 的解决方案。
你的
Podfile
里有这个吗? rn >=0.72 设置不同。
def node_require(script)
# Resolve script with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", __dir__]).strip
end
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')
platform :ios, min_ios_version_supported
prepare_react_native_project!
setup_permissions([
'Camera',
])