Error running Android Studio APP

1

When trying to run my APP with Android studio, I get this error

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/location/places/PlaceReport.class

I have looked through a thousand sites and they say that something is duplicated, but I do not know what to do anymore, I have done clean / rebuild, invalidate / cache any idea how to solve it?

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.example.dam.proyectocristian"
        minSdkVersion 16
        targetSdkVersion 25
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions{
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'

    }

}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:design:25.1.1'
    compile 'com.android.support:support-annotations:25.1.1'

    compile 'com.android.support:support-v4:25.1.1'

    compile 'com.google.firebase:firebase-auth:9.2.1'
    compile 'com.firebase:firebase-client-android:2.4.0'

    compile 'com.google.android.gms:play-services-maps:9.0.0'
    compile 'com.google.android.gms:play-services-location:9.0.0'

    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'
    
asked by Cristian Prieto Beltran 31.03.2017 в 09:46
source

1 answer

1

The class java.util.zip.ZipException is duplicated, in the dependencies:

compile 'com.android.support:support-annotations:25.1.1'
compile 'com.android.support:support-v4:25.1.1'

You can add the configuration block so that you only have the class of a dependency:

    android{
   ...    
   ...
   ...        
        configurations {
            all*.exclude group: 'com.android.support', module: 'support-v4'
            all*.exclude group: 'com.android.support', module: 'support-annotations'
        }

    }

Review the dependency configuration section.

link

    
answered by 31.03.2017 / 19:48
source