I have this error:
Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzrf.class
I want to add google play services to my project, so I put this line in the build.gradle file:
compile 'com.google.android.gms:play-services:7.8.0'
So, I had to enable multidex, and I followed the android doc by adding this to build.gradle:
compile 'com.android.support:multidex:1.0.1'
and
multiDexEnabled true
I add this to the android manifest:
<application ... android:name="android.support.multidex.MultiDexApplication">
But I have a mistake that I wrote above. I found many questions regarding this problem (app: packageAllDebugClassesForMultiDex), but not with this (duplicate entry: com / google / android / gms / internal / zzrf.class).
I tried some solutions, such as removing some Google libraries, but I donβt know what is related to internal / zzrf.class.
Here is my gradle file:
apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "fr.djey.testgoogleplus" minSdkVersion 16 targetSdkVersion 22 versionCode 1 versionName "1.0" multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.google.android.gms:play-services:7.8.0' compile 'com.android.support:multidex:1.0.1' }
source share