m.v.n.kalyani
m.v.n.kalyani

Reputation: 770

Unable to build apk file in Android Studio

I am trying to build apk but I'm unable to create it.Getting the following errors.But project running successfully.my android studio version 2.2.2

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

my gradle file is:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.wedding.weddingapp"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        configurations { all*.exclude module: 'gson-2.5' }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven { url "https://raw.githubusercontent.com/layerhq/releases-android/master/releases/" }
    maven { url "https://raw.githubusercontent.com/layerhq/Atlas-Android/master/releases/" }
}
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:multidex:1.0.0'
    compile 'com.layer.atlas:layer-atlas:0.3.6'
    compile 'com.google.firebase:firebase-messaging:9.8.0'
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'
    compile 'com.android.volley:volley:1.0.0'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.support:support-v4:25.1.0'
    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.android.support:cardview-v7:25.1.0'


    testCompile 'junit:junit:4.12'
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

Upvotes: 3

Views: 1545

Answers (1)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75798

You are getting

TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/common/api/zzd.class

You should use latest version of Firebase

 compile 'com.google.firebase:firebase-messaging:10.0.1'

and use

 buildToolsVersion "25.0.1"

Thean Clean-Rebuild-Restart your IDE

Upvotes: 1

Related Questions