Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/maps/GoogleMapOptions.class未知的構建問題(APP:transformClassesWithJarMergingForDebug)
Gradle sync started Gradle sync completed Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] Gradle build finished in 16s 492ms Executing tasks: [:app:assembleDebug] Gradle build finished with 1 error(s) in 8s 883ms
以下是應用程序建立的gradle(模塊:APP)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.accordhk.vexus"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
aidl.srcDirs = ['src/main/java']
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.google.firebase:firebase-messaging:9.0.1'
compile 'com.isseiaoki:simplecropview:1.1.4'
compile 'com.google.android.gms:play-services-maps:9.0.1'
compile files('libs/PIA_FrameWork.jar')
compile files('libs/gson-2.0.jar')
compile files('libs/locSDK_3.3.jar')
compile files('libs/xUtils-2.6.14.jar')
compile 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
compile files('libs/iport.jar')
}
搖籃同步完成,但搖籃構建了其在上述BLOCKQUOTE提到的錯誤,但我不知道如何解決這個問題。任何人都可以給我一些解決方案來解決這個問題?非常感謝你。
謝謝您的答覆。但仍然得到了同樣的問題T_T – ng2b30
嘗試的build.gradle添加此 'afterEvaluate { tasks.matching { it.name.startsWith( 'DEX') } {。每個DX - > 如果(dx.additionalParameters = = NULL){ dx.additionalParameters = [ '--multi-DEX'] }否則{ dx.additionalParameters + = '--multi-DEX' } } }' –
感謝。仍然沒有變化 – ng2b30