[英]Execution failed for task ':app:transformClassesWithJarMergingForDebug
I am created an android app & is running above API level 21. But not running on below API level 21. 我创建了一个Android应用程序并且运行在API级别21之上。但是没有在API级别21以下运行。
Here is error log: 这是错误日志:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. 错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。 com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl.class Help me through com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android / support / v4 / accessibilityservice / AccessibilityServiceInfoCompat $ AccessibilityServiceInfoVersionImpl.class帮助我完成
Below is my gradle code: 以下是我的gradle代码:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "*******"
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
packagingOptions {
exclude 'META-INF/NOTICE.txt' // will not include NOTICE file
exclude 'META-INF/LICENSE.txt' // will not include LICENSE file
}
}
dependencies {
compile fileTree(exclude: 'android-support-*.jar', dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile project(':simple-crop-image-lib')
// compile 'com.github.navasmdc:MaterialDesign:+'
compile project(':material-login')
compile 'com.android.support:multidex:1.0.1'
compile ('com.android.support:appcompat-v7:23.4.0'){
exclude module: 'support-v4'
}
}
First Compile the build with 首先编译构建
compile 'com.android.support:multidex:1.0.1' 编译'com.android.support:multidex:1.0.1'
In Your AndroidManifest.xml add this lines android:name 在你的AndroidManifest.xml中添加这行android:name
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name="android.support.multidex.MultiDexApplication"
>
And In your build.gradle also add 在你的build.gradle中也添加
dexOptions {
//incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/NOTICE.txt' // will not include NOTICE file
exclude 'META-INF/LICENSE.txt' // will not include LICENSE file
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.