Android media3 Gradle 8.4 AGP 8.3.0

109 Views Asked by At

I've been using media3 in an Android app for the better part of a year. Yesterday I updated gradle to 8.4 and the Android Gradle Plugin to 8.3.0. I ran it through a battery of tests, including running a qa build that obfuscates it. Everything looked fine. I published it. It was a crashfest. Crash-free users 5%. Ugh. As soon as we make connection to the service (as far as I can tell, remember I can't reproduce this locally).

Fatal Exception: java.lang.IllegalAccessError: Illegal class access: 'G2.c2' attempting to access 'com.google.common.util.concurrent.ImmediateFuture' (declaration of 'G2.c2' appears in base.apk)
   at androidx.media3.session.MediaSessionStub.lambda$queueSessionTaskWithPlayerCommandForControllerInfo$13(MediaSessionStub.java:338)
   at androidx.media3.session.ConnectedControllersManager.lambda$flushCommandQueue$2(ConnectedControllersManager.java:277)
   at androidx.media3.session.MediaSessionImpl.lambda$callWithControllerForCurrentRequestSet$3(MediaSessionImpl.java:318)
   at androidx.media3.common.util.Util.postOrRun(Util.java:761)
   at androidx.media3.session.ConnectedControllersManager.flushCommandQueue(ConnectedControllersManager.java:271)
   at androidx.media3.session.ConnectedControllersManager.flushCommandQueue(ConnectedControllersManager.java:252)
   at androidx.media3.session.MediaSessionStub.lambda$flushCommandQueue$64(MediaSessionStub.java:1653)
   at androidx.media3.common.util.Util.postOrRun(Util.java:761)
   at androidx.media3.session.MediaSessionStub.flushCommandQueue(MediaSessionStub.java:1651)
   at androidx.media3.session.MediaControllerImplBase$FlushCommandQueueHandler.flushCommandQueue(MediaControllerImplBase.java:3290)
   at androidx.media3.session.MediaControllerImplBase$FlushCommandQueueHandler.handleMessage(MediaControllerImplBase.java:3283)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loopOnce(Looper.java:211)
   at android.os.Looper.loop(Looper.java:300)
   at android.app.ActivityThread.main(ActivityThread.java:8294)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)

None of my code is in the stacktrace (that's always fun). I couldn't be the only one using media3 and new versions of the tools, could I? One thing to note, I publish an app bundle, the play store builds the actual apks. I'm using media3 1.2.1 (and have been for a few release without any big issues) I thought it might be some other change I made, but reverting the build tools definitely fixed it. I made one internal release where that was the only change, and that's the one to starting working again.

So my big question is why? Android Studio is hounding me to update the tools. But I really need to know what happened and what to do about it. Since it works locally (even with minify on), it sure feels to R8/Proguard issue. Its been a while since I've hit R8/Proguard issues that I couldn't reproduce with qa build (which is basically a release build signed with the debug key).

0

There are 0 best solutions below