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

[BUG] Camera view with .NET 9 is causing crash on Android #2377

Closed
2 tasks done
MarianHristov92 opened this issue Dec 11, 2024 · 2 comments · Fixed by #2215
Closed
2 tasks done

[BUG] Camera view with .NET 9 is causing crash on Android #2377

MarianHristov92 opened this issue Dec 11, 2024 · 2 comments · Fixed by #2215
Labels
bug Something isn't working unverified

Comments

@MarianHristov92
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

Saw the video of Gerald Versluis:
https://www.youtube.com/watch?v=XFVrIyAzsk4
Tried to implement the same logic for my .NET 9 project and when you debug the app and try to open the app. Unfortunately I cannot revert to .NET 8. The result is:

System.MissingMethodException: Method not found: void AndroidX.Camera.Core.Preview.SetSurfaceProvider(AndroidX.Camera.Core.Preview/ISurfaceProvider)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[d__14](d__14& stateMachine)
at CommunityToolkit.Maui.Core.CameraManager.StartUseCase(CancellationToken token)
at CommunityToolkit.Maui.Core.CameraManager.<>c__DisplayClass41_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
at Android.App.SyncContext.<>c__DisplayClass2_0.b__0() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:line 36
at Java.Lang.Thread.RunnableImplementor.Run() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:line 37
at Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net9.0/android-35/mcw/Java.Lang.IRunnable.cs:line 59
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V callback, IntPtr jnienv, IntPtr klazz) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 22

Expected Behavior

Camera should be able to open and take picture

Steps To Reproduce

  1. Open and run the solution on android target sdk 35

Link to public reproduction project repository

https://github.com/MarianHristov92/MauiCameraViewNet9

Environment

- .NET MAUI CommunityToolkit:9.1.1 
- .NET MAUI CommunityToolkit.Maui.Camera: 1.0.5
- OS: ANDROID 15
- .NET MAUI: 9.0.12

Anything else?

No response

@MarianHristov92 MarianHristov92 added bug Something isn't working unverified labels Dec 11, 2024
@TheCodeTraveler TheCodeTraveler mentioned this issue Dec 11, 2024
6 tasks
@dharamhbtik
Copy link

Getting same error when I am using barcode scanner.

@Light407
Copy link

Did you resolve this?

@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working unverified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants