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

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

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

dharamhbtik opened this issue Dec 21, 2024 · 4 comments
Labels
bug Something isn't working needs reproduction stale The author has not responded in over 30 days unverified

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

@dharamhbtik
Copy link
Author

try to open it 2 or three times

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 2 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@dotnet-policy-service dotnet-policy-service bot added the stale The author has not responded in over 30 days label Jan 6, 2025
Copy link
Contributor

We haven't received a reproduction sample from you. The issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs reproduction stale The author has not responded in over 30 days unverified
Projects
None yet
Development

No branches or pull requests

2 participants