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] Unable to load camera with Community Toolkit update 2.0.0 #2410

Open
2 tasks done
dharamhbtik opened this issue Dec 21, 2024 · 2 comments
Open
2 tasks done

[BUG] Unable to load camera with Community Toolkit update 2.0.0 #2410

dharamhbtik opened this issue Dec 21, 2024 · 2 comments
Labels

Comments

@dharamhbtik
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

We have migrated our app to .NET 9 from .NET 8 and we were using community toolkit camera for taking pictures. After updating the toolkit to latest version which was released on 18th December 2024, it started crashing the app .

It is throwing below error

[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Method not found: void AndroidX.Camera.Core.Preview.SetSurfaceProvider(AndroidX.Camera.Core.Preview/ISurfaceProvider)
[mono-rt]    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<StartUseCase>d__14](<StartUseCase>d__14& stateMachine)
[mono-rt]    at CommunityToolkit.Maui.Core.CameraManager.StartUseCase(CancellationToken token)
[mono-rt]    at CommunityToolkit.Maui.Core.CameraManager.<>c__DisplayClass41_0.<<PlatformConnectCamera>b__0>d.MoveNext() in /_/src/CommunityToolkit.Maui.Camera/CameraManager.android.cs:line 164
[mono-rt] --- End of stack trace from previous location ---
[mono-rt]    at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
[mono-rt]    at Android.App.SyncContext.<>c__DisplayClass2_0.<Post>b__0() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:line 36
[mono-rt]    at Java.Lang.Thread.RunnableImplementor.Run() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:line 37
[mono-rt]    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
[mono-rt]    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 open with preview and user should be able to capture images.

Steps To Reproduce

  1. Download the samples provided in the community toolkit repo
  2. Update the toolkit camera version to latest version
  3. run the application and open the camera page
  4. It will crash

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui/tree/b01a18dcef03f955523b8ec71a3f02ec98c96824/samples/CommunityToolkit.Maui.Sample

Environment

- .NET MAUI CommunityToolkit:10.0.0
- OS: Android 13
- .NET MAUI: 9.0

Anything else?

No response

@dharamhbtik dharamhbtik added bug Something isn't working unverified labels Dec 21, 2024
Copy link
Contributor

Hi @dharamhbtik! 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 Reporting a bug section of our Contributing.md that you confirmed reading before you submitted this Issue, we ask that every Issue author provide a link to an open-source repository containing the reproduction sample app. This issue will be closed automatically in 5 days if we do not receive a reproduction sample from you. Please feel free to re-open this Issue once you have provided a reproduction sample.

@brminnick
Copy link
Collaborator

Please provide us a sample reproduction to help us fix the bug. I am unable to reproduce this error.

Here is a screen shot of the CameraView page running in CommunityToolkit.Maui.Sample:

Image

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

No branches or pull requests

2 participants