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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting Bluetooth device causes crash (stemming from MediaBrowserService.OnDestroy()) #873

Open
1 of 7 tasks
rhedgpeth opened this issue Aug 19, 2022 · 2 comments
Open
1 of 7 tasks

Comments

@rhedgpeth
Copy link

rhedgpeth commented Aug 19, 2022

馃悰 Bug Report

Currently have an app that will crash when connecting a known bluetooth device. The app itself targets Android 12, and is using Plugin.MediaManager.Form v1.1.1. It also seems to be occurring almost exclusively on Google Pixel devices, if that's at all helpful.

It's unclear to me what is causing the crash, but I suspect, based on some of the logs below, that it might have something to do with the targeted Android version (possibly related to this feature request?) Or maybe it's environmental.. not sure.

08-17 12:09:47.374  5390  5390 I MediaPlayerList: Adding wrapped media player: com.xxx.xxx at key: 2
08-17 12:09:47.397  5621  5621 V mono-stdout: com.xxx.xxx: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
08-17 12:09:47.397  5621  5621 V mono-stdout: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
08-17 12:09:47.407  5390  5390 I AvrcpBrowsedPlayerWrapper: onConnected: com.xxx.xxx is connected
08-17 12:09:47.407  5390  5390 D AvrcpBrowsablePlayerConnector: Browse player callback called: package=com.xxx.xxx : status=0
08-17 12:09:47.407  5390  5390 D AvrcpBrowsablePlayerConnector: Received a message: msg.what=1
08-17 12:09:47.407  5390  5390 I AvrcpBrowsablePlayerConnector: Checking root contents for com.xxx.xxx
08-17 12:09:47.428  1789  2000 D CompatibilityChangeReporter: Compat change id reported: 168419799; UID 10432; state: DISABLED
08-17 12:09:47.433  5621  5621 D AndroidRuntime: Shutting down VM
08-17 12:09:47.433  5621  5621 E AndroidRuntime: FATAL EXCEPTION: main
08-17 12:09:47.433  5621  5621 E AndroidRuntime: Process: com.xxx.xxx, PID: 5621
08-17 12:09:47.433  5621  5621 E AndroidRuntime: android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
08-17 12:09:47.433  5621  5621 E AndroidRuntime:   at MediaManager.Platforms.Android.MediaSession.MediaBrowserService.OnDestroy () [0x0004c] in <2d77835a04ac470c9ff4c7b0511fd250>:0 
08-17 12:09:47.433  5621  5621 E AndroidRuntime:   at Android.App.Service.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <56d36f98164f4038b32ab84f04a73483>:0 
08-17 12:09:47.433  5621  5621 E AndroidRuntime:   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.7(intptr,intptr)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at crc646e364d2ff34954e7.MediaBrowserService.n_onDestroy(Native Method)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at crc646e364d2ff34954e7.MediaBrowserService.onDestroy(MediaBrowserService.java:58)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at android.app.ActivityThread.handleStopService(ActivityThread.java:4736)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at android.app.ActivityThread.access$2100(ActivityThread.java:256)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2134)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7870)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
08-17 12:09:47.433  5621  5621 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Expected behavior

The app would not crash.

Reproduction steps

Open app, background to connect a bluetooth device.

Configuration

Version: 1.1.1

Platform:

  • 馃摫 iOS
  • 馃 Android
  • 馃弫 WPF
  • 馃寧 UWP
  • 馃崕 MacOS
  • 馃摵 tvOS
  • 馃悞 Xamarin.Forms
@EBusch
Copy link

EBusch commented Feb 8, 2023

Just wanted to add a +1 and say I am also seeing this behavior, happy to help provide more details if needed.

@martijn00
Copy link
Member

This might be fixed in 1.2.2

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

No branches or pull requests

3 participants