-
Notifications
You must be signed in to change notification settings - Fork 414
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
Camera view with .NET 9 crashes on Android #2438
Comments
same here. We are unable to migrate to .net 9 because of that |
same here. |
I have the same issue. The problem is that the CommunityToolkit uses outdated NuGet for To fix this problem, I've only changed 2 things: Here is the NuGet that includes those changes if anyone wants to try it: |
@UlriCode would you be willing to open a PR to resolve this? |
I am unable to reproduce this error. @bijington Are you able to reproduce the reported crash? I confirmed that the provided reproduction sample works on both my Android Emulator (Android API 35) and my Google Pixel (Android API 31). I also confirmed that the CameraView page in our Community Toolkit Sample app works on my Android Emulator (Android API 35). @UlriCode Could you please provide more information on how to reproduce the crash? We are blocked from merging your PR until we can reproduce the existing error and confirm that your PR fixes it.
|
Hi @jacobilsoe! We have added the
needs reproduction
label to this issue, which indicates that we are unable to take further action until you provide a reproduction sample that we can use to reproduce + fix your bug. In accordance with the |
@brminnick here is a crude project that reproduce the problem: Pizzaui.zip Just tap on "ShowCameraView" to see the crash. This project contains another NuGet If you remove |
@UlriCode Yep, I also use |
@UlriCode thank you for the investigation there to work out the issue. It makes sense why @brminnick couldn't reproduce the issue. What I propose is that we thoroughly test that this new version doesn't introduce any issues and if all is fine we merge 👍 |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
There is an existing bug for this but it was closed and is now locked for updating: #2377
I have the exact same issue as described in that bug so I suspect it might not have been properly fixed.
My stacktrace:
01-13 13:49:15.312 F/mono-rt ( 5558): [ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method not found: void AndroidX.Camera.Core.Preview.SetSurfaceProvider(AndroidX.Camera.Core.Preview/ISurfaceProvider)
01-13 13:49:15.312 F/mono-rt ( 5558): at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[d__14](d__14& stateMachine)
01-13 13:49:15.312 F/mono-rt ( 5558): at CommunityToolkit.Maui.Core.CameraManager.StartUseCase(CancellationToken token)
01-13 13:49:15.312 F/mono-rt ( 5558): at CommunityToolkit.Maui.Core.CameraManager.<>c__DisplayClass41_0.<b__0>d.MoveNext() in /_/src/CommunityToolkit.Maui.Camera/CameraManager.android.cs:line 164
01-13 13:49:15.312 F/mono-rt ( 5558): --- End of stack trace from previous location ---
01-13 13:49:15.312 F/mono-rt ( 5558): at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
01-13 13:49:15.312 F/mono-rt ( 5558): 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
01-13 13:49:15.312 F/mono-rt ( 5558): at Java.Lang.Thread.RunnableImplementor.Run() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:line 37
01-13 13:49:15.312 F/mono-rt ( 5558): 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
01-13 13:49:15.312 F/mono-rt ( 5558): 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
No crash
Steps To Reproduce
See Current Behavior
Link to public reproduction project repository
https://github.com/MarianHristov92/MauiCameraViewNet9
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: