10

I'm getting these errors in my android app and here is the LogCat.

> Error:Execution failed for task
> ':android:transformClassesWithJarMergingForDebug'.
>  com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry:
> org/webrtc/voiceengine/WebRtcAudioRecord.class

I am trying to integrate a second WebRTC to my android app, I have integrated TokBox jar in my project and now I'm trying to put VSee SDK in app as well, I'm guessing both have WebRTC libraries so, I'm getting that duplicate error but I'm unable finding a way to exclude 1 of those to fix the duplicate error.

So far I tried to add this on my app's Gradle build.

> exclude group: 'org.webrtc'

But it's not working, can someone help me with this? Thanks in advance!

  • 1
    Did you any solution, because am also facing the same issue. – Jeevanandhan Aug 20 '16 at 08:26
  • I'm getting similar issue with log : **Error:Execution failed for task ':app:transformClassesWithJarMergingForProudctDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/webrtc/voiceengine/BuildInfo.class** Did you got answer for this ? – CoDe Jan 17 '17 at 10:28

3 Answers3

0

I just got the same error. turnd out, in my case, it was simply as written: "duplicate". I had the same "compile" line on "build.gradle" - "dependencies". It was always there, the error started to jump after I upgraded android studio (2.2) and gradle version ('classpath 'com.android.tools.build:gradle:2.2.0')

I removed one of the duplicate lines and the error was gone.

NBApps
  • 461
  • 4
  • 12
  • Your answer has been plagiarized on another forum http://asktoanswer.com/questions/duplicate-webrtc-class-in-android/ – Bhargav Rao Jan 24 '17 at 06:59
0

Check that none of your dependencies conflict e.g. you don't have module A that depends on X 1.0 and Y 1.0 but X 1.0 depends on Y 2.0.

Or I've found a simple clean and rebuild fixes a similar error.

Ryan
  • 1,843
  • 11
  • 20
0

Try ./gradlew clean in the root build folder and re-build. If that doesn't work run ./gradlew app:dependencies or ./gradlew assembleDebug --debug to figure out the dependency conflicts so you can exclude the duplicate class.

Kevin Brotcke
  • 3,015
  • 22
  • 32
  • So I know dependency and cause of conflicting. In my case I'm using two 3rd part WebRTC based solution and both uses same class name **BuildInfo.class**, and this causing issue. Any suggestion ? – CoDe Jan 23 '17 at 03:51
  • The duplicate class names shouldn't be an issue if the package names are different. Maybe they are both depending on a different version of a library? – Kevin Brotcke Jan 23 '17 at 19:06
  • but this is actually causing issue, you see same I added in comment above. **duplicate entry: org/webrtc/voiceengine/BuildInfo.class** – CoDe Jan 25 '17 at 09:52