xamarin / Essentials

Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials.
https://aka.ms/xamarin-upgrade
Other
1.53k stars 505 forks source link

[Bug] Crash: IllegalArgumentException: Receiver not registered: android.hardware.camera2.CameraManager #1770

Open holecekp opened 3 years ago

holecekp commented 3 years ago

Description

I am using Microsoft AppCenter and I have received the following crash report for my application. The application uses Xamarin.Essentials to turn on/off the flashlight. The app itself does not use a camera in any other way.

Exception: java.lang.IllegalArgumentException: Receiver not registered: android.hardware.camera2.CameraManager$1@8bacc91 Stack trace:

    android.app.LoadedApk.forgetReceiverDispatcher LoadedApk.java:789
    android.app.ContextImpl.unregisterReceiver ContextImpl.java:1200
    android.hardware.camera2.CameraManager$3.run CameraManager.java:1266
    android.os.Handler.handleCallback Handler.java:815
    android.os.Handler.dispatchMessage Handler.java:104
    android.os.Looper.loop Looper.java:207
    android.app.ActivityThread.main ActivityThread.java:5769
    java.lang.reflect.Method.invoke Method.java
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run ZygoteInit.java:789
    com.android.internal.os.ZygoteInit.main ZygoteInit.java:679

Android version: 6.0

The app works fine on the phones that I use for testing but all of them have a newer Android version (10). It is possible that the crash appears only in older Android versions.

Steps to Reproduce

I am not able to reproduce it on my phone.

Basic Information

holecekp commented 3 years ago

Is there any progress on this bug? I have received several other crash reports. This time the device is AllView A5 Ready and the Android version is 6.0.

holecekp commented 2 years ago

Any progress? I keep receiving other crash reports on various devices. The Android version is always 6.0 so the bug is probably specific to this version.