我尝试使用Android Studio运行我的Android应用程序,并显示错误说明以下消息。
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/sap/maf/uicontrols/logonui/res/BuildConfig.class
似乎有一个重复的库,这就是它停止运行的原因。但老实说,我不知道应该使用build.gradle文件修复哪些内容。所以我把build.gradle文件放在这里。
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "abcd.test.com.abcd"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.android.support:multidex:1.0.0'
compile project(':maflogonui12122')
compile project(':mafsettingscreen12122')
compile project(':mafuicomponents12122')
compile files('libs/AfariaSLL-7.00.6169.0.jar')
compile files('libs/ClientHubSLL-3.12.2.jar')
compile files('libs/ClientLog-3.12.2.jar')
compile files('libs/Common-3.12.2.jar')
compile files('libs/Connectivity-3.12.2.jar')
compile files('libs/CoreServices-3.12.2.jar')
compile files('libs/DataVaultLib-3.12.2.jar')
compile files('libs/E2ETrace-3.12.2.jar')
compile files('libs/HttpConvAuthFlows-3.12.2.jar')
compile files('libs/HttpConversation-3.12.2.jar')
compile files('libs/maflogger-1.212.2.jar')
compile files('libs/maflogoncore-1.212.2.jar')
compile files('libs/maflogonui.jar')
compile files('libs/mafsettingscreen.jar')
compile files('libs/mafuicomponents.jar')
compile files('libs/MobilePlace.jar')
compile files('libs/ODataAPI-3.12.2.jar')
compile files('libs/odataoffline.jar')
compile files('libs/ODataOnline-3.12.2.jar')
compile files('libs/perflib-1.2.0.jar')
compile files('libs/Request-3.12.2.jar')
compile files('libs/sap-e2etrace-2.3.5.300.jar')
compile files('libs/SupportabilityFacade-3.12.2.jar')
compile files('libs/XscriptParser-3.12.2.jar')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
答案 0 :(得分:1)
似乎你编译两次maf-realted组件两次:第一次作为项目,第二次作为lib(就像你有编译项目(':maflogonui12122'),但也编译文件('libs / maflogonui.jar'))。所以,尝试删除其中一个。
答案 1 :(得分:0)
我遇到了同样的问题,我找到了解决方案。
将项目的minSdkVersion更改为21.:)