Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to activate instance of type Barcode.Scanning.BarcodeAnalyzer after update from 1.5.7 to 1.5.8 #99

Open
oleg-varlamov opened this issue Oct 4, 2024 · 4 comments

Comments

@oleg-varlamov
Copy link

After upgrade library from 1.5.7 to 1.5.8 we have an exception when detection performed:
Unable to activate instance of type Barcode.Scanning.BarcodeAnalyzer from native handle

image

@afriscic
Copy link
Owner

afriscic commented Oct 4, 2024

Can you share more details please? OS, device, version...

@oleg-varlamov
Copy link
Author

Sure!

MauiVersion: 8.0.91
OS: Android 14
Device: Galaxy A23

Here is the stack trace:

 	0xFFFFFFFFFFFFFFFF in Android.Runtime.RuntimeNativeMethods.monodroid_debugger_unhandled_exception	C#
 	0x1A in Android.Runtime.JNINativeWrapper._unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:12,5	C#
 	0x1E in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:122,26	C#
 	0x186 in Java.Interop.TypeManager.CreateInstance at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:318,5	C#
 	0x21 in Java.Lang.Object.GetObject at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:303,4	C#
 	0x1E in Java.Lang.Object._GetObject<Android.Gms.Tasks.IOnCompleteListener> at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:289,4	C#
 	0x2 in Java.Lang.Object.GetObject<Android.Gms.Tasks.IOnCompleteListener> at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:281,4	C#
 	0x8 in Java.Lang.Object.GetObject<Android.Gms.Tasks.IOnCompleteListener> at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:275,4	C#
 	0x3 in Android.Gms.Tasks.IOnCompleteListenerInvoker.n_OnComplete_Lcom_google_android_gms_tasks_Task_ at D:\a\_work\1\s\generated\com.google.android.gms.play-services-tasks\obj\Release\net8.0-android\generated\src\Android.Gms.Tasks.IOnCompleteListener.cs:84,4	C#
 	0x9 in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:121,5	C#

@haideralifaizi
Copy link

I am also getting but i solve it by using:
CameraEnabled = false;
await Shell.Current.Navigation.PopAsync(true);
I have to first disabled camera and then, do all things like back or anything. Like when i detect, i have to first off cameraenabled false and then, it does not occur

@afriscic
Copy link
Owner

I haven't managed to replicate the issue as I'm using Shell for navigation. But if @haideralifaizi solves your problem then it is a issue with internal resource mismanagement when navigating from the page. Although it can work without it, it is a best practice to set CameraEnabled = false when closing or navigating from the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants