Task :app:checkReleaseDuplicateClasses FAILED

Hello there!

Im integrating the player (bitmovin-player-react-native) in my react-native app.

My situation is the following:
Im currently using react-native-video for the player inside the app. but now I want to start using bitmovin-player-react-native in SOME PARTS of the app. so the requirement is that both players can co-live.

In iOS there is no problem, its already integrated and working.
but in Android im having the issue of duplicated classes when trying to build the app.

Execution failed for task ':app:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.google.android.exoplayer2.AbstractConcatenatedTimeline found in modules jetified-exoplayer-core-2.18.1-runtime (com.google.android.exoplayer:exoplayer-core:2.18.1) and jetified-exoplayer-core-2.18.1.0-runtime (com.bitmovin.player:exoplayer-core:2.18.1.0)
     Duplicate class com.google.android.exoplayer2.AudioBecomingNoisyManager found in modules jetified-exoplayer-core-2.18.1-runtime (com.google.android.exoplayer:exoplayer-core:2.18.1) and jetified-exoplayer-core-2.18.1.0-runtime (com.bitmovin.player:exoplayer-core:2.18.1.0)
     Duplicate class com.google.android.exoplayer2.AudioBecomingNoisyManager$AudioBecomingNoisyReceiver found in modules jetified-exoplayer-core-2.18.1-runtime (com.google.android.exoplayer:exoplayer-core:2.18.1) and jetified-exoplayer-core-2.18.1.0-runtime (com.bitmovin.player:exoplayer-core:2.18.1.0)
     Duplicate class com.google.android.exoplayer2.AudioBecomingNoisyManager$EventListener found in modules jetified-exoplayer-core-2.18.1-runtime (com.google.android.exoplayer:exoplayer-core:2.18.1) and jetified-exoplayer-core-2.18.1.0-runtime (com.bitmovin.player:exoplayer-core:2.18.1.0)
...
...
...
and more...

Im already following the exact steps from the documentation but no success yet,

Any help is appreciated!

Thank very much,
Mateo

Hi @mateo , welcome to the Bitmovin community and thanks for sharing your issue. From the issue description it seems that you are using Exoplayer library directly in your application along with Bitmovin player SDK. Using both together can lead to duplicate classes issue.

Bitmovin player SDK is also delivered with decorated class names to avoid conflict with Exoplayer classes if present in same application. The general best practice for such case is available in our tutorial Can I use ExoPlayer and the Bitmovin Player Android SDK in the same project?

Coming to you specific use case of React Native SDK, can you please try to replace the Bitmovin native SDK dependency from implementation 'com.bitmovin.player:player:3.39.0' at line in React Native project to implementation 'com.bitmovin.player:player:3.39.0+jason' and check if it helps resolve your issue.

Please do let us know if there are any followup questions.

Hi @mateo , is there any update on this issue? Did you get chance to try above suggestion.

Also wanted to share that Bitmovin will update the RN repo to use +jason suffixed player SDK by default in future. This will help with deployments wherein Exoplayer is also used directly in the application.

I will update this thread as soon as a release with this change is available.