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.

2

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On

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.