You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've come across an issue which crashes the app under iOS. I've tested on the latest version 1.5.8, and as far back as 1.3.1 and the issue is there too.
To recreate this, in BarcodeScanning.Test, click the 'Open ScanPage' button.
Then when asked for camera permissions, click 'Don't Allow'.
Then click the '<' back button.
Finally, click 'Open ScanPage' again, and the app crashes, giving this error: System.Exception: 'Could not initialize an instance of the type 'AVFoundation.AVCaptureDeviceInput': the native 'initWithDevice:error:' method returned nil. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.'
On this line of code: _captureInput = new AVCaptureDeviceInput(_captureDevice, out _);
In MaciOS/CameraManager.cs
In short it seems like the crash happens when permissions have been denied and the user lands on a page with the CameraView on it.
For reference, I'm running iOS version 17.5.1 on an IPhone 12. We've had users telling us they're having this issue with our app too.
I'm not sure about a workaround at the moment, but I'm going to try only injecting the CameraView into the page if camera permissions are granted and see how that goes.
The text was updated successfully, but these errors were encountered:
To avoid coupling the permissions into the client app, it would be good to add a method alongside Methods.AskForRequiredPermissionAsync called HasRequiredPermissionAsync.
Hello there,
I've come across an issue which crashes the app under iOS. I've tested on the latest version 1.5.8, and as far back as 1.3.1 and the issue is there too.
To recreate this, in BarcodeScanning.Test, click the 'Open ScanPage' button.
Then when asked for camera permissions, click 'Don't Allow'.
Then click the '<' back button.
Finally, click 'Open ScanPage' again, and the app crashes, giving this error:
System.Exception: 'Could not initialize an instance of the type 'AVFoundation.AVCaptureDeviceInput': the native 'initWithDevice:error:' method returned nil. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.'
On this line of code:
_captureInput = new AVCaptureDeviceInput(_captureDevice, out _);
In MaciOS/CameraManager.cs
In short it seems like the crash happens when permissions have been denied and the user lands on a page with the CameraView on it.
For reference, I'm running iOS version 17.5.1 on an IPhone 12. We've had users telling us they're having this issue with our app too.
I'm not sure about a workaround at the moment, but I'm going to try only injecting the CameraView into the page if camera permissions are granted and see how that goes.
The text was updated successfully, but these errors were encountered: