[英]Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. >
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. 错误:任务':app:transformClassesWithMultidexlistForDebug'的执行失败。
java.io.IOException: Can't write [C:\\Users\\ACERNRC\\Desktop\\WORK\\woo\\woo_1\\FashionsNrc\\app\\build\\intermediates\\multi-dex\\debug\\componentClasses.jar] (Can't read [C:\\Users\\ACERNRC.gradle\\caches\\transforms-1\\files-1.1\\Woocommerce-Android-Client-0.0.3.aar\\c97bb2466b99eaef9958dcb4fe44dc0d\\jars\\libs\\google-http-client-1.20.0.jar(;;;;;;**.class)] (Duplicate zip entry [google-http-client-1.20.0.jar:com/google/api/client/json/JsonPolymorphicTypeMap$TypeDef.class])) java.io.IOException:无法编写[C:\\ Users \\ ACERNRC \\ Desktop \\ WORK \\ woo \\ woo_1 \\ FashionsNrc \\ app \\ build \\ intermediates \\ multi-dex \\ debug \\ componentClasses.jar](无法读取[ C:\\ Users \\ ACERNRC.gradle \\ caches \\ transforms-1 \\ files-1.1 \\ Woocommerce-Android-Client-0.0.3.aar \\ c97bb2466b99eaef9958dcb4fe44dc0d \\ jars \\ libs \\ google-http-client-1.20.0.jar(; ;;;;; **。class)](重复的zip条目[google-http-client-1.20.0.jar:com / google / api / client / json / JsonPolymorphicTypeMap $ TypeDef.class]))
How to solve this? 如何解决呢?
This is my app gradle file, after multidex option hide in default config 这是我的应用程序gradle文件,在multidex选项隐藏在默认配置中之后
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.acernrc.fashionsnrc"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// multiDexEnabled true
/** dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}**/
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.github.rajatady:Woocommerce-Android-Client:0.0.3'
implementation 'com.github.vajro:MaterialDesignLibrary:1.6'
implementation 'com.github.ozodrukh:CircularReveal:1.3.1@aar'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
implementation project(':woocommerce')
}
After sync shows Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. 同步后显示错误:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'执行失败。
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex java.lang.RuntimeException:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex
In your local.properties file just add size mentioned below 在您的local.properties文件中,只需添加下面提到的大小
org.gradle.jvmargs=-XX:MaxHeapSize\\=512m -Xmx512m org.gradle.jvmargs = -XX:MaxHeapSize \\ = 512m -Xmx512m
In your app gradle 在您的应用程序中
defaultConfig {
applicationId "<PACKAGE NAME>"
minSdkVersion 8
versionCode 1
versionName "1.0"
targetSdkVersion 26
multiDexEnabled true //this is important
}
Try this 尝试这个
In build.gradle
: 在build.gradle
:
defaultConfig {
multiDexEnabled true
}
dependencies {
implementation 'com.android.support:multidex:1.0.1'
}
Clean your project and rebuild. 清理您的项目并重建。
In build.gradle: 在build.gradle中:
defaultConfig {
multiDexEnabled true
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
}
But notice that you use the old version sdk 但是请注意,您使用的是旧版本的sdk
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.