taycaldwell / riot-api-java

Riot Games API Java Library
http://taycaldwell.github.io/riot-api-java/
Apache License 2.0
190 stars 73 forks source link

Unable to Merge dex #124

Closed Joefahing closed 6 years ago

Joefahing commented 6 years ago

Hi This is the first time I used an api in Android studio. However, I keep running in to this bug

"Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex"

whenever I tried to build project.

I follow all the steps to edited

dependencies{ ... implementation 'com.google.code.gson:gson:2.8.2' implementation 'com.github.taycaldwell:riot-api-java:4.0.1' }

riot-api-java.jar to external lib

allproject{ ... maven { url 'https://jitpack.io' } }

A quick reply would be appreciated because I am doing this as a hackaton project. Thank you!

taycaldwell commented 6 years ago

Can you share the build.gradle file for both your project and the module for which you are declaring the dependencies? Also it shouldn't matter, but what JDK are you using for the project?

Joefahing commented 6 years ago

I am currently using JDK 9.0.4, so I assume Android studio is also using 9.0.4.

code for project and module gradle.zip

Thank you and I truly appreciate you help

taycaldwell commented 6 years ago

I am unable to reproduce this issue with your same setup.

Have you already tried enabling MultiDex in your build.gradle file (i.e. multiDexEnabled true), or doing a Clean/Rebuild on your project?

Joefahing commented 6 years ago

Thank you, the bug was because I also added .jar to my external library. As soon as I deleted that, the bug is gone.

taycaldwell commented 6 years ago

Awesome. If you have any other questions, please feel free to reach out or open a new issue.

Good luck at the hackathon!