2

I am using both Exoplayer and Bitmovin libraries in my project

compile "com.google.android.exoplayer:exoplayer:$rootConfiguration.exoPlayerVersion"
compile "com.bitmovin.analytics:collector:$rootConfiguration.bitmovinVersion"

and:

exoPlayerVersion = '2.8.4'
bitmovinVersion = '1.3.8'

When I run my app it gives me this error

`AGPBI: {"kind":"error","text":"Program type already present: `com.google.android.exoplayer2.source.hls.BuildConfig","sources":[{}],"tool":"D8"}

How can I exclude Exoplayer files from Bitmovin?

P.S. It was working fine until version 1.2.0

Keivan Esbati
  • 2,855
  • 1
  • 17
  • 35
Harsh
  • 569
  • 3
  • 18

1 Answers1

2

To Exoplayer files from Bitmovin library just change your dependency like this:

compile("com.bitmovin.analytics:collector:$rootConfiguration.bitmovinVersion") {
        // Necessary to avoid version conflicts
        exclude group: 'com.google.android.exoplayer', module: 'exoplayer'
        // Or simply
        exclude module: 'exoplayer'
    }
Keivan Esbati
  • 2,855
  • 1
  • 17
  • 35
  • I used the following code and it worked but there are other complexities using proguard now: compile ("com.bitmovin.analytics:collector:$rootConfiguration.bitmovinVersion"){ exclude group: 'com.bitmovin.player', module: 'exoplayer-smoothstreaming' exclude group: 'com.bitmovin.player', module: 'exoplayer-hls' exclude group: 'com.bitmovin.player', module: 'exoplayer-dash' exclude group: 'com.bitmovin.player', module: 'exoplayer-core' exclude group: 'com.bitmovin.player', module: 'exoplayer-ui' } – Harsh Sep 09 '18 at 06:26
  • Why you exclude the com.bitmovin.player modules? usually is not a good practice to remove library modules especially the related libraries like this unless stated by its developers. For proguard did you added the recommended setting? -keep class com.bitmovin.player.** { *; } -keep interface com.bitmovin.player.** { *; } – Keivan Esbati Sep 09 '18 at 06:42
  • Excluding individual modules worked : exclude module: 'exoplayer-smoothstreaming' exclude module: 'exoplayer-hls' exclude module: 'exoplayer-dash' exclude module: 'exoplayer-core' exclude module: 'exoplayer-ui' Yes I added those settings for proguard but still getting this error : com.bitmovin.player.a.d.a.a: can't find referenced method 'com.google.android.exoplayer2.text.ttml.TtmlDecoder$FrameAndTickRate parseFrameAndTickRates(org.xmlpull.v1.XmlPullParser)' in program class com.bitmovin.player.a.d.a.a – Harsh Sep 09 '18 at 09:53
  • Is it ok when proguard isn't running? Please create a new question and attach your proguard file. – Keivan Esbati Sep 09 '18 at 10:40
  • Alright. I think it is do with latest release of Bitmovin. It was working fine until 1.2.0. Will create a separate question for this. Thanks – Harsh Sep 09 '18 at 10:57