SiriDx / qrcode

A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.
MIT License
71 stars 47 forks source link

iOS app crashes if access to the camera is disallowed after the fact #34

Open ookamisensei opened 3 years ago

ookamisensei commented 3 years ago

Here's the scenario: -start the plugin, and given that you've configured your iOS app correctly, it'll start the camera.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureSession addInput:] Can't add a nil AVCaptureInput'
*** First throw call stack:
(0x199a2d86c 0x1aea48c50 0x1b3dbfba4 0x100992208 0x100991dc4 0x100992a78 0x100a9deac 0x100a99400 0x100daea60 0x100abfd7c 0x100dc9070 0x100d631d4 0x100d659fc 0x1999a9fa0 0x1999a9ba0 0x1999a8ffc 0x1999a2ee4 0x1999a221c 0x1b156e784 0x19c3e2ee8 0x19c3e875c 0x1004f76d0 0x1996626b0)
libc++abi.dylib: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001c7982414 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1c7982414 <+8>:  b.lo   0x1c7982434               ; <+40>
    0x1c7982418 <+12>: pacibsp 
    0x1c798241c <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1c7982420 <+20>: mov    x29, sp
Target 0: (Runner) stopped.
Lost connection to device.