3

I have added the below two libraries (ExoPlayer and GeckoView) to my Android App in Android Studio:

dependencies {
    ...
    implementation 'com.google.android.exoplayer:exoplayer:2.11.1'
    implementation ('org.mozilla.geckoview:geckoview-beta:73.0.20200109090448')
    ...
}

When I started building the project, I realized that these libraries have conflicts together (the Gradle Sync was successful):

Duplicate class com.google.android.exoplayer2.BaseRenderer found in modules jetified-exoplayer-core-2.11.1-runtime.jar (com.google.android.exoplayer:exoplayer-core:2.11.1) and jetified-geckoview-beta-73.0.2020...-runtime.jar (org.mozilla.geckoview:geckoview-beta:73.0.202001...)
Duplicate class com.google.android.exoplayer2.... found in modules jetified-exoplayer-core-2.11.1-runtime.jar (com.google.android.exoplayer:exoplayer-core:2.11.1) and jetified-geckoview-beta-73.0.2020...-runtime.jar (org.mozilla.geckoview:geckoview-beta:73.0.2020...)

I got so many lines of error like the above. So I decided to exclude the ExoPlayer group from the GeckoView (because I already have that):

...
implementation ('org.mozilla.geckoview:geckoview-beta:73.0.20200109090448') {
    exclude group: 'com.google.android.exoplayer2', module: 'jetified-geckoview-beta-73.0.20200109090448-runtime.jar'
}
...

I synced again (the Sync was successful again) and started building, but no effects, the errors occurred again.

What should I do?

HF_
  • 689
  • 3
  • 9
  • 22

1 Answers1

-1

From the duplicate message, the issue is that the classes are found in the geckoview-beta runtime jar itself and in the exoplayer jar as well.

So this is not a conflict of transitives, but a direct conflict between geckoview-beta and exoplayer.

You will have to resolve this by removing one of the two libraries or finding a version of geckoview-beta that does not embed the classes in com.google.android.exoplayer2 package.

Louis Jacomet
  • 13,661
  • 2
  • 34
  • 43
  • I can't downgrade the GeckoView or remove one of the two libraries. Any other ways? – HF_ Jan 13 '20 at 12:15