Open legion151 opened 1 year ago
Interesting error, what device is this ?
Device is a Huawei P40 lite 5G with android 10.
I noticed the error occurs, when i quickly route between two components which both execute the above code. I now check if the camera allready has permissions like so:
if (!this.camera.hasCameraPermission()) {
try {
await this.camera.requestCameraPermission()
} catch (e) {
console.log("Error no permission");
return;
}
}
this.camera.pause = false;
and cannot trigger the error anymore.
Permissions were granted before triggering the error in either case. I previously assumed that
this.camera.requestCameraPermission()
would internally check if it really has to ask for permissions and resolve immediately if permissions where allready granted, which seems not to be the case, leading to the error if it happens fast.
Only my theory though.
Hi,
i sometimes (not always) get an IllegalArgumentExcpetion while asking for cameraPermissions in my app. My code is as follows:
I do this everytime the MLKitView gets loaded. The catch is not reached instead i get
i guess i'm doing it wrong - any hints welcome.
using: "@angular/core": "~15.2.0", "@nativescript/core": "~8.5.0", "@nativescript/mlkit-barcode-scanning": "^2.0.0", "@nativescript/mlkit-core": "^2.0.0",
Thank you in advance.