I am try to use the new android multidex support for a project. I have some problem with this exception:
Error:Execution failed for task ':shineV3:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: com/google/android/gms/analytics/internal/Command$1.class
about the problem. I use 2 different jar package as dependency, and some class will be duplicated in classes.dex because both jars contains they. any idea? thanks in Advance
If you are integrating
Google Analytics V2
andGoogle play services
in your app, then you need to do the following in your gradle file:It worked for me. Hope it will work for others too. :)
For those that are coming into this, I figured out why this was happening. For me it was that I was compiling the Google Analytics V2 jar as well as the full play services. Google allows you to break down what play services you really need for you app and compile those individual items. Check them out here. I excluded the Google Play Analytics which is on V4 right now and it worked
adding this to your grdale compile "com.google.android.gms:play-services:7.5.+" means adding all play services including analytics, maps, vcm .. etc. you can add
as guides mentions:
https://developers.google.com/android/guides/setup