[TOC]java
Android編譯異常 Cause: duplicate entry: META-INF/MANIFEST.MF
解決方案2: 治標又治本(暫無)
解決方案1: 治標不治本(還原大法)
- 還原到
classpath 'com.android.tools.build:gradle:3.4.2'
便可.
參考資料
問題詳情
-
舊項目 AndroidStudio3.4 編譯正常android
classpath 'com.android.tools.build:gradle:3.4.2'
apigradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
app -
升級到 AndroidStudio3.5 編譯報錯gradle
classpath 'com.android.tools.build:gradle:3.5.2'
uigradle/wrapper/gradle-wrapper.propertiesspa
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
debug -
報錯詳情code
Cause: duplicate entry: META-INF/MANIFEST.MF
ormCaused by: java.util.zip.ZipException: duplicate entry: META-INF/MANIFEST.MF at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:232) at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109) at com.android.builder.packaging.JarMerger.write(JarMerger.java:252) at com.android.builder.packaging.JarMerger.addJar(JarMerger.java:199) at com.android.builder.packaging.JarMerger.addJar(JarMerger.java:156) at com.android.build.gradle.internal.dependency.AarToClassTransform$Companion.copyEntryTo(AarToClassTransform.kt:94) at com.android.build.gradle.internal.dependency.AarToClassTransform$Companion.copyAllClassesJarsTo(AarToClassTransform.kt:90) at com.android.build.gradle.internal.dependency.AarToClassTransform$Companion.access$copyAllClassesJarsTo(AarToClassTransform.kt:83) at com.android.build.gradle.internal.dependency.AarToClassTransform.transform(AarToClassTransform.kt:78) at org.gradle.api.internal.artifacts.transform.DefaultTransformer.transform(DefaultTransformer.java:173) at
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':EasyAndroid:javaPreCompileDebug'. > Could not resolve all files for configuration ':EasyAndroid:debugCompileClasspath'. > Failed to transform artifact 'leakcanary-android-1.5.4.aar (:leakcanary-android-1.5.4:)' to match attributes {artifactType=android-classes, org.gradle.usage=java-api}. > Execution failed for AarToClassTransform: libs\leakcanary-android-1.5.4.aar. > duplicate entry: META-INF/MANIFEST.MF