Hello Mux team!
In our project, we just upgraded the ExoPlayer from r2.12.1 to r2.16.1. So, we also upgraded MuxExoPlayer v2.4.15 for ExoPlayer r2.12.1 to MuxExoPlayer v2.6.0 for ExoPlayer r2.16.1. In this upgrade, we also started pulling the MuxExoPlayer library from your jfrog repository, rather than including the .AAR locally. This was successful, but I want to make you aware of an issue I ran into along the way.
To preface, we use Mux with the ExoPlayer Amazon port library, rather than Google's vanilla ExoPlayer.
When we upgraded, we tried to include the MuxExoPlayer library, along with the ExoPlayer Amazon port, in one of our project's modules this way:
api "com.amazon.android:exoplayer:$exo_player_version"
api "com.amazon.android:extension-workmanager:$exo_player_version"
api "com.amazon.android:extension-cast:$exo_player_version"
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.24.0'
api('com.mux.stats.sdk.muxstats:MuxExoPlayer_r2_16_1:2.6.0')
However, when the app is compiled, the build fails with a list of duplicate class errors, like the following:
Duplicate class com.google.android.exoplayer2.AbstractConcatenatedTimeline found in modules jetified-exoplayer-core-2.16.1-runtime (com.amazon.android:exoplayer-core:2.16.1) and jetified-exoplayer-core-2.16.1-runtime (com.google.android.exoplayer:exoplayer-core:2.16.1)
You can view the entire list of duplicate classes here:
ExoPlayer-Build-Error.txt
If we replace the ExoPlayer Amazon port with the vanilla ExoPlayer, like below, then the build completes successfully:
api "com.google.android.exoplayer:exoplayer:$exo_player_version"
api "com.google.android.exoplayer:extension-workmanager:$exo_player_version"
api "com.google.android.exoplayer:extension-cast:$exo_player_version"
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.24.0'
api('com.mux.stats.sdk.muxstats:MuxExoPlayer_r2_16_1:2.6.0')
And finally, in order to continue using the ExoPlayer Amazon port in conjunction with MuxExoPlayer, we have added the following exclude statements when including the MuxExoPlayer:
api "com.amazon.android:exoplayer:$exo_player_version"
api "com.amazon.android:extension-workmanager:$exo_player_version"
api "com.amazon.android:extension-cast:$exo_player_version"
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.24.0'
api('com.mux.stats.sdk.muxstats:MuxExoPlayer_r2_16_1:2.6.0') {
exclude(group: "com.google.android.exoplayer", module: "exoplayer")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-core")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-extractor")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-common")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-datasource")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-ui")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-transformer")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-smoothstreaming")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-rtsp")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-hls")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-dash")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-decoder")
exclude(group: "com.google.android.exoplayer", module: "exoplayer-database")
}
When all of the duplicate ExoPlayer classes from Google are excluded, like above, the ExoPlayer classes from Amazon are kept, the build completes, and the app runs as expected. So, this solution works for us, but I wanted to make you aware of this, in case MuxExoPlayer is leaking its internal ExoPlayer dependencies. This issue did not occur until upgrading to MuxExoPlayer v2.6.0.