ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Random failure while signing for an APK

Open LloydBlv opened this issue 3 years ago • 8 comments

While the tasks for signing the APK are going on a specific task fails with the following feedback:

* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
   > Compilation failed to complete, position: Lcom/google/android/exoplayer2/source/dash/manifest/DashManifestParser;parseMediaPresentationDescription(Lorg/xmlpull/v1/XmlPullParser;Landroid/net/Uri;)Lcom/google/android/exoplayer2/source/dash/manifest/DashManifest;, origin: /Users/sa/.gradle/caches/transforms-3/5b877f18430bbf29b75cb7d9cd8a8daa/transformed/exoplayer-dash-2.17.1-runtime.jar:com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.class


Tried to bump to recent exo, etc, but still it fails, the wrapper version used is "7.5-rc-2" and the gradle version is : "7.4.0-alpha07"

Can someone please pointout what is going on?

LloydBlv avatar Jul 07 '22 14:07 LloydBlv

  • Have you tried including the classes in question to proguard rules ?

Also, are you using ExoPlayer all-around dependency or declaring each part of ExoPlayer independently ? This may perhaps happen due to a conflict of versions between ExoPlayer parts.

yuroyami avatar Jul 07 '22 21:07 yuroyami

The mentioned classes are added to the proguard rules file. A unified version is being used for all the exo dependencies actually 2.17.1. Also tried to use recent version, 2.18.0 and still same issue.

LloydBlv avatar Jul 11 '22 06:07 LloydBlv

Thanks for reporting! I can repro this with a new project in Android Studio that plays a DASH sample. I can't repros with the demo app. Marking as bug. We need to investigate this.

com.android.tools.r8.internal.f20: Unused argument with users in com.google.android.exoplayer2.source.dash.manifest.DashManifest com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parseMediaPresentationDescription(org.xmlpull.v1.XmlPullParser, android.net.Uri)

marcbaechinger avatar Jul 11 '22 10:07 marcbaechinger

Testing on the new media3 dependencies produces the same result, fails on :app:minifyReleaseWithR8 task

LloydBlv avatar Jul 11 '22 10:07 LloydBlv

Looks like a bug in the tooling to me - probably in the Android Gradle Plugin.

When downgrading for instance to 7.2.1 (Android Gradle Plugin version) it works for me with Gradle version 7.3.3 and 7.4. With an Android Gradle Plugin above 7.2.1 it fails for me. Can you confirm this?

marcbaechinger avatar Jul 11 '22 11:07 marcbaechinger

I can confirm that 7.2.1 worked fine but any version above fails

LloydBlv avatar Jul 11 '22 12:07 LloydBlv

Any other update on this or downgrading is the only way to fix this?

ArcherEmiya05 avatar Jul 21 '22 02:07 ArcherEmiya05

I don't think that is a library issue that we can fix on the library side. Fixing this would probably need a fix in R8/plugin or you need to work around that the minimizer wants to do it's work. I think downgrading to a Gradle Plugin that does not exhibit the problem is currently the easiest fix.

I would guess when this is fixed it would need to upgrade to a Gradle Plugin that is not affected, but this is guesswork on my side. I have reported the problem with internal bugref: b/240282988 and will update this issue as soon as I hear something.

marcbaechinger avatar Jul 26 '22 16:07 marcbaechinger

This has been fixed in R8 and is contained in R8 3.3.75.

Using the Android Gradle Plugin 7.2.2 fixed the problem for me with Android Studio Dolphin, and Android Gradle Plugin 7.4.0-alpha09 with Android Studio Electric Eel | 2022.1.1 Canary 9.

Can you please verify and re-open the issue if you are still having problems when using the AGP versions above.

marcbaechinger avatar Aug 18 '22 23:08 marcbaechinger

@marcbaechinger thanks. You're my life saver!

================================= Need to downgrade to 7.2.2??

classpath 'com.android.tools.build:gradle:7.3.0'

Unused argument with users in com.google.android.exoplayer2.source.dash.manifest.DashManifest com.google.android.exoplayer2.source.dash.manifest.DashManifestParser.parseMediaPresentationDescription(org.xmlpull.v1.XmlPullParser, android.net.Uri)

hungntv avatar Oct 04 '22 08:10 hungntv