Sachin salunkhe
Sachin salunkhe

Reputation: 100

Getting exception while adding libraries in build.gradle

Here is my build.gradle. while adding google analytics dependency I am getting exception like below TransformException: java.util.zip.ZipException: duplicate entry: android/support/multidex/BuildConfig.class

 apply plugin: 'com.android.application'

    android {
        compileSdkVersion 22
        buildToolsVersion '21.0.1'
        defaultConfig {
            applicationId "***.***.***"
            minSdkVersion 17
            targetSdkVersion 22
            versionCode 1
            versionName "1.0"
            multiDexEnabled true
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        productFlavors {
        }
    }

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.google.code.gson:gson:2.2.+'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.5.0'
        compile files('libs/retrofit.jar')
        compile files('libs/parceler-api.jar')
        compile files('libs/android-binding-v30-0.5.jar')
        compile 'info.hoang8f:android-segmented:1.0.6'
        compile 'com.squareup.retrofit2:retrofit:2.0.2'
        compile 'com.squareup.okhttp3:okhttp:3.2.0'
        compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0'
        compile 'io.reactivex:rxandroid:1.0.1'
        compile 'com.squareup.retrofit2:converter-gson:2.0.2'
        compile files('libs/YouTubeAndroidPlayerApi.jar')
        compile files('libs/acra-4.6.1.jar')
        compile 'com.android.support:multidex:1.0.0'
        compile files('libs/achartengine-1.1.0.jar')
        compile 'com.android.support:appcompat-v7:22.0.0'
        compile 'com.android.support:appcompat-v7:22.2.0'
        compile 'me.relex:circleindicator:1.2.1@aar'
        compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
        compile 'com.google.android.gms:play-services-analytics:8.1.0'
        compile 'com.google.android.gms:play-services:8.1.0'
        compile 'com.google.android.gms:play-services-ads:8.1.0'

Upvotes: 0

Views: 183

Answers (1)

xbadal
xbadal

Reputation: 1375

remove this compile 'com.google.android.gms:play-services:8.1.0'

and this is also duplicated compile 'com.android.support:appcompat-v7:22.0.0' and use compile com.google.android.gms:play-services-gcm:9.6.1' for GCM

Upvotes: 1

Related Questions