Reputation: 508
I am testing my app on and iOS and scanning qr codes functionality https://pub.dev/packages/qr_mobile_vision is not working for me with error mentioned in title.
I add
platform :ios, '11.0'
I make both other steps mentioned in package site but I am still getting this error.
I have
<key>NSCameraUsageDescription</key>
in my info.plist file under Runner folder and I don't have idea what I can do more to fix it?
Maybe this is just happening on iOS simulator? I don't have possibility to check it on physical iOS device.
Upvotes: 1
Views: 1117
Reputation: 188
1: in bottom of your PodFile set camera like this,
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_CAMERA=1',
]
end
end
end
but iOS Simulator has no camera, like other answer mentioned.
Upvotes: 1
Reputation: 1574
The iOS Simulator has no camera, as you mentioned this is a simulator specific issue. You will need to run your app on a physical device.
Upvotes: 1