簡體   English   中英

無法在Android Studio中構建apk文件

[英]Unable to build apk file in Android Studio

我正在嘗試構建apk但我無法創建它。獲取以下錯誤。但項目運行成功。我的android工作室版本2.2.2

錯誤:任務':app:transformClassesWithJarMergingForDebug'的執行失敗。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重復條目:com / google / android / gms / common / api / zzd.class

我的gradle文件是:

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'

你來了

TransformException:java.util.zip.ZipException:重復條目:com / google / android / gms / common / api / zzd.class

您應該使用最新版本的Firebase

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

並使用

 buildToolsVersion "25.0.1"

Thean Clean-Rebuild - 重新啟動 IDE

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM