Closed arodriguezgb closed 1 year ago
This is still happening. I have no idea what it can be.
Changing the mediasessioncompat to this mediaSession = new MediaSessionCompat(this, TAG); from this mediaSession = new MediaSessionCompat(this, TAG, null, pendingItent);
Fixes this crash. The component name being null is "MAYBE" whats causing it.
Im sure this can be fixed properly but Im not sure how. @monkeyswarm I just debugged a bit till I found the offending part.
I'll take a look. I'm guessing we want to switch from MediaSessionCompat to MediaSession.
I'm guessing this deprecation is somehow involved : https://developer.android.com/reference/android/media/session/MediaSession#setMediaButtonReceiver(android.app.PendingIntent) and that we will want to specify a BroadcastReceiver in the manifest.
Can you find any behavior that is no longer supported with your fix? I forget what the use case was for that pending intent, the docs imply that it's for hardware buttons (i.e. on headsets).
I submitted https://github.com/google/flutter.plugins/pull/138 with your suggested change; let me know if this creates any new issues, thanks.
I will test today with headsets etc to see if there is something not working as expected but with the phone itself its all working fine.
``This crash is weird, it started all of the sudden , does anyone know what it could be ?
✓ Built build/app/outputs/flutter-apk/app-debug.apk. Installing build/app/outputs/flutter-apk/app.apk... E/AndroidRuntime(21677): FATAL EXCEPTION: main E/AndroidRuntime(21677): Process: gentlebirth.app, PID: 21677 E/AndroidRuntime(21677): java.lang.RuntimeException: Unable to create service com.google.flutter.plugins.audiofileplayer.AudiofileplayerService: java.lang.IllegalArgumentException: ComponentName does not belong to sessionPackageName. sessionPackageName = gentlebirth.app, ComponentName pkg = com.google.android.apps.youtube.music
Edit:
The crash seems to be only happening on my Pixel 6 Pro with Latest Update. Im not sure if its something wrong in the latest Android 13 update. Ill keep monitoring.
Edit 2:
The issue seems to be here, because if i comment everything inside OnCreate, the app builds but obviously the player doesn't work well. This is happening on Android 13 QPR1 Beta 2 and 3.
} `