錯誤消息
`錯誤:執行失敗,對於任務 ':app:transformClassesWithJarMergingForDebug'。我得到執行時間上的錯誤
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/annotations/Beta.class`
的build.gradle(Module.app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.jd.travelsdemo"
minSdkVersion 19
targetSdkVersion 25
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
configurations.all {
resolutionStrategy {
force 'com.google.code.findbugs:jsr305:1.3.9', 'com.google.code.findbugs:jsr305:2.0.1'
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.github.clans:fab:1.6.4'
compile 'com.basgeekball:awesome-validation:2.0'
//gmail api dependencies
compile 'com.google.android.gms:play-services-auth:10.2.4'
compile('com.google.api-client:google-api-client-android:1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-gmail:v1-rev44-1.22.0') {
exclude group: 'org.apache.httpcomponents'
}
compile 'junit:junit:4.12'
}
您的第三方庫之一正在使用您引用的庫的不同版本。它應該警告你在android studio中存在不匹配。尋找你的依賴之一,被橙色/淺米色 – Doomsknight
後輸出從'gradlew應用程序:依賴關係' – DeKaNszn
輸出 – Jigish