【发布时间】:2017-07-17 12:09:27
【问题描述】:
当我尝试构建我的项目时,我的项目出现错误多个 dex 文件定义 Lcom/google/android/gms/common/api/zzeonly。下面是我的 gradle 文件。
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并成功安装在设备上。
标签: android android-studio gradle build build.gradle