我收到我的項目錯誤多個dex文件定義Lcom/google/android/gms/common/api/zzeonly當我試圖建立我的項目。以下是我的gradle文件。我的項目獲取gradle錯誤多個dex文件定義Lcom/google/android/gms/common/api/zze
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "my app id"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.jakewharton:butterknife:8.6.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.volley:volley:1.0.0'
compile 'io.nlopez.smartlocation:library:3.2.9'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}
apply plugin: 'com.google.gms.google-services'
我在gradle中添加multidex後出現這個錯誤。 錯誤:任務':app:transformClassesWithJarMergingForDebug'的執行失敗。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複條目:com/google/android/gms/common/api/zze.class 當我嘗試安裝應用程序通過設置即時運行我能夠生成apk併成功安裝在設備上。 – AndroidDev