Error:Execution Failed for task ':transformClassesWithJarMergingForDeBUG'.> com.androID.build.API.transform.transformException: java.util.zip.ZipException: duplicate entry: androID/support/v4/harDWare/display/displayManagerCompat.class@H_404_3@当我在调试模式下运行时,应用程序构建没有问题,但是,当我尝试构建APK时,我得到上面的错误.
有没有办法可以追踪重复的包裹?我运行了以下内容:
./gradlew -q dependencIEs :dependencIEs --configuration compile------------------------------------------------------------Root project------------------------------------------------------------compile - Classpath for compiling the main sources.+--- com.androID.support:multIDex:1.0.1+--- com.androID.support:appcompat-v7:25.0.0| +--- com.androID.support:support-vector-drawable:25.0.0| | \--- com.androID.support:support-compat:25.0.0| | \--- com.androID.support:support-annotations:25.0.0| \--- com.androID.support:animated-vector-drawable:25.0.0| \--- com.androID.support:support-vector-drawable:25.0.0 (*)+--- project :deps:androID-map-utils:library| \--- project :deps:Google-maps-m4b\--- project :deps:Google-play-services(*) - dependencIEs omitted (Listed prevIoUsly)@H_404_3@这是我的build.gradle
// top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositorIEs { jcenter() } dependencIEs { classpath 'com.androID.tools.build:gradle:2.2.2' }}apply plugin: 'com.androID.application'dependencIEs { compile 'com.androID.support:multIDex:1.0.1' compile 'com.androID.support:appcompat-v7:25.0.0' compile filetree(include: '*.jar',dir: 'libs') compile filetree(include: '*.jar',dir: 'lib') compile project(':deps:Google-maps-m4b') compile project(':deps:androID-map-utils:library') compile project(':deps:Google-play-services')}androID { compileSdkVersion 24 buildToolsversion '25.0.0' packagingOptions { exclude 'meta-inf/DEPENDENCIES.txt' exclude 'meta-inf/DEPENDENCIES' exclude 'meta-inf/dependencIEs.txt' exclude 'meta-inf/liCENSE.txt' exclude 'meta-inf/liCENSE' exclude 'meta-inf/license.txt' exclude 'meta-inf/LGPL2.1' exclude 'meta-inf/NOTICE.txt' exclude 'meta-inf/NOTICE' exclude 'meta-inf/notice.txt' } defaultConfig { // Already hit dex limit multIDexEnabled true dexOptions { javaMaxHeapSize "4g" } } lintoptions { abortOnError false } sourceSets { main { manifest.srcfile 'AndroIDManifest.xml' java.srcDirs = ['src'] aIDl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] jnilibs.srcDirs = ['libs'] } // Move the tests to tests/java,tests/res,etc... instrumentTest.setRoot('tests') // Move the build types to build-types/<type> // For instance,build-types/deBUG/java,build-types/deBUG/AndroIDManifest.xml,... // This moves them out of them default location under src/<type>/... which would // conflict with src/ being used by the main source set. // Adding new build types or product flavors should be accompanIEd // by a similar customization. deBUG.setRoot('build-types/deBUG') release.setRoot('build-types/release') }}allprojects { repositorIEs { jcenter() }}@H_404_3@libs中的文件:armeabi / libcryptowrapper.so
lib中的文件:ClIEntCertUtil.jarapache-mime4j-0.6.jarcommons-codec-1.6.jarcommons-io-2.4.jarcommons-logging-1.1.3.jargcm.jarhttpclIEnt-4.3.4.jarhttpclIEntandroIDlib-1.2.1.jarhttpcore-4.3.jarhttpmime-4.3.1.jarjavarosa.jarjoda-time-2.0.jarkxml2-2.3.0.jarmgrs.jaropencsv-2.3.jarregexp-me.jarzip4j_1.3.2.jar@H_404_3@将exclude module:’support-v4’添加到appcompat-v7时,构建失败仍然显示调试日志,无法加载索引超出范围的主活动,长度:0,索引:3:
Error:warning: Ignoring InnerClasses attribute for an anonymous inner classError:(net.lingala.zip4j.unzip.Unzip$1) that doesn't come with anError:associated EnclosingMethod attribute. This class was probably produced by aError:compiler that dID not target the modern .class file format. The recommendedError:solution is to recompile the class from source,using an up-to-date compilerError:and without specifying any "-target" type options. The consequence of ignoringError:this warning is that reflective operations on this class will incorrectlyError:indicate that it is *not* an inner class.@H_404_3@运行
./gradlew -q projects------------------------------------------------------------Root project------------------------------------------------------------Root project 'opendatakit-collect'\--- Project ':deps' +--- Project ':deps:androID-map-utils' | \--- Project ':deps:androID-map-utils:library' +--- Project ':deps:Google-maps-m4b' \--- Project ':deps:Google-play-services'@H_404_3@运行./gradlew:依赖项,因为我似乎没有项目名称:
Incremental java compilation is an incubating feature.:dependencIEs------------------------------------------------------------Root project------------------------------------------------------------_deBUGAndroIDTestAnnotationProcessor - ## Internal use,do not manually configure ##No dependencIEs_deBUGAndroIDTestApk - ## Internal use,do not manually configure ##\--- com.androID.support:multIDex-instrumentation:1.0.1 \--- com.androID.support:multIDex:1.0.1_deBUGAndroIDTestCompile - ## Internal use,do not manually configure ##\--- com.androID.support:multIDex-instrumentation:1.0.1 \--- com.androID.support:multIDex:1.0.1_deBUGAnnotationProcessor - ## Internal use,do not manually configure ##No dependencIEs_deBUGApk - ## Internal use,do not manually configure ##+--- com.androID.support:multIDex:1.0.1+--- com.androID.support:appcompat-v7:25.0.0| +--- com.androID.support:support-vector-drawable:25.0.0| | \--- com.androID.support:support-compat:25.0.0| | \--- com.androID.support:support-annotations:25.0.0| \--- com.androID.support:animated-vector-drawable:25.0.0| \--- com.androID.support:support-vector-drawable:25.0.0 (*)+--- project :deps:Google-maps-m4b+--- project :deps:androID-map-utils:library| \--- project :deps:Google-maps-m4b\--- project :deps:Google-play-services_deBUGCompile - ## Internal use,do not manually configure ##+--- com.androID.support:multIDex:1.0.1+--- com.androID.support:appcompat-v7:25.0.0| +--- com.androID.support:support-vector-drawable:25.0.0| | \--- com.androID.support:support-compat:25.0.0| | \--- com.androID.support:support-annotations:25.0.0| \--- com.androID.support:animated-vector-drawable:25.0.0| \--- com.androID.support:support-vector-drawable:25.0.0 (*)+--- project :deps:Google-maps-m4b+--- project :deps:androID-map-utils:library| \--- project :deps:Google-maps-m4b\--- project :deps:Google-play-services_deBUGUnitTestAnnotationProcessor - ## Internal use,do not manually configure ##No dependencIEs_deBUGUnitTestApk - ## Internal use,do not manually configure ##No dependencIEs_deBUGUnitTestCompile - ## Internal use,do not manually configure ##No dependencIEs_releaseAnnotationProcessor - ## Internal use,do not manually configure ##No dependencIEs_releaseApk - ## Internal use,do not manually configure ##+--- com.androID.support:multIDex:1.0.1+--- com.androID.support:appcompat-v7:25.0.0| +--- com.androID.support:support-vector-drawable:25.0.0| | \--- com.androID.support:support-compat:25.0.0| | \--- com.androID.support:support-annotations:25.0.0| \--- com.androID.support:animated-vector-drawable:25.0.0| \--- com.androID.support:support-vector-drawable:25.0.0 (*)+--- project :deps:Google-maps-m4b+--- project :deps:androID-map-utils:library| \--- project :deps:Google-maps-m4b\--- project :deps:Google-play-services_releaseCompile - ## Internal use,do not manually configure ##+--- com.androID.support:multIDex:1.0.1+--- com.androID.support:appcompat-v7:25.0.0| +--- com.androID.support:support-vector-drawable:25.0.0| | \--- com.androID.support:support-compat:25.0.0| | \--- com.androID.support:support-annotations:25.0.0| \--- com.androID.support:animated-vector-drawable:25.0.0| \--- com.androID.support:support-vector-drawable:25.0.0 (*)+--- project :deps:Google-maps-m4b+--- project :deps:androID-map-utils:library| \--- project :deps:Google-maps-m4b\--- project :deps:Google-play-services_releaseUnitTestAnnotationProcessor - ## Internal use,do not manually configure ##No dependencIEs_releaseUnitTestApk - ## Internal use,do not manually configure ##No dependencIEs_releaseUnitTestCompile - ## Internal use,do not manually configure ##No dependencIEsandroIDJacocoAgent - The Jacoco agent to use to get coverage data.\--- org.jacoco:org.jacoco.agent:0.7.5.201505241946androIDJacocoAnt - The Jacoco ant tasks to use to get execute Gradle tasks.\--- org.jacoco:org.jacoco.ant:0.7.5.201505241946 +--- org.jacoco:org.jacoco.core:0.7.5.201505241946 | \--- org.ow2.asm:asm-deBUG-all:5.0.1 +--- org.jacoco:org.jacoco.report:0.7.5.201505241946 | +--- org.jacoco:org.jacoco.core:0.7.5.201505241946 (*) | \--- org.ow2.asm:asm-deBUG-all:5.0.1 \--- org.jacoco:org.jacoco.agent:0.7.5.201505241946androIDTestAnnotationProcessor - Classpath for the annotation processor for 'androIDTest'.No dependencIEsandroIDTestApk - Classpath packaged with the compiled 'androIDTest' classes.No dependencIEsandroIDTestCompile - Classpath for compiling the androIDTest sources.No dependencIEsandroIDTestProvIDed - Classpath for only compiling the androIDTest sources.No dependencIEsandroIDTestWearapp - link to a wear app to embed for object 'androIDTest'.No dependencIEsannotationProcessor - Classpath for the annotation processor for 'main'.No dependencIEsapk - Classpath packaged with the compiled 'main' classes.No dependencIEsarchives - Configuration for archive artifacts.No dependencIEscompile - Classpath for compiling the main sources.+--- com.androID.support:multIDex:1.0.1+--- com.androID.support:appcompat-v7:25.0.0| +--- com.androID.support:support-vector-drawable:25.0.0| | \--- com.androID.support:support-compat:25.0.0| | \--- com.androID.support:support-annotations:25.0.0| \--- com.androID.support:animated-vector-drawable:25.0.0| \--- com.androID.support:support-vector-drawable:25.0.0 (*)+--- project :deps:Google-maps-m4b+--- project :deps:androID-map-utils:library| \--- project :deps:Google-maps-m4b\--- project :deps:Google-play-servicesdeBUGAnnotationProcessor - Classpath for the annotation processor for 'deBUG'.No dependencIEsdeBUGApk - Classpath packaged with the compiled 'deBUG' classes.No dependencIEsdeBUGCompile - Classpath for compiling the deBUG sources.No dependencIEsdeBUGProvIDed - Classpath for only compiling the deBUG sources.No dependencIEsdeBUGWearapp - link to a wear app to embed for object 'deBUG'.No dependencIEsdefault - Configuration for default artifacts.No dependencIEsdefault-mapPing - Configuration for default mapPing artifacts.No dependencIEsdefault-Metadata - Metadata for the produced APKs.No dependencIEsinstrumentTestAnnotationProcessor - Classpath for the annotation processor for 'instrumentTest'.No dependencIEsinstrumentTestApk - Classpath packaged with the compiled 'instrumentTest' classes.No dependencIEsinstrumentTestCompile - Classpath for compiling the instrumentTest sources.No dependencIEsinstrumentTestProvIDed - Classpath for only compiling the instrumentTest sources.No dependencIEsinstrumentTestWearapp - link to a wear app to embed for object 'instrumentTest'.No dependencIEsprovIDed - Classpath for only compiling the main sources.No dependencIEsreleaseAnnotationProcessor - Classpath for the annotation processor for 'release'.No dependencIEsreleaseApk - Classpath packaged with the compiled 'release' classes.No dependencIEsreleaseCompile - Classpath for compiling the release sources.No dependencIEsreleaseProvIDed - Classpath for only compiling the release sources.No dependencIEsreleaseWearapp - link to a wear app to embed for object 'release'.No dependencIEstestAnnotationProcessor - Classpath for the annotation processor for 'test'.No dependencIEstestApk - Classpath packaged with the compiled 'test' classes.No dependencIEstestCompile - Classpath for compiling the test sources.No dependencIEstestDeBUGAnnotationProcessor - Classpath for the annotation processor for 'testDeBUG'.No dependencIEstestDeBUGApk - Classpath packaged with the compiled 'testDeBUG' classes.No dependencIEstestDeBUGCompile - Classpath for compiling the testDeBUG sources.No dependencIEstestDeBUGProvIDed - Classpath for only compiling the testDeBUG sources.No dependencIEstestDeBUGWearapp - link to a wear app to embed for object 'testDeBUG'.No dependencIEstestProvIDed - Classpath for only compiling the test sources.No dependencIEstestReleaseAnnotationProcessor - Classpath for the annotation processor for 'testRelease'.No dependencIEstestReleaseApk - Classpath packaged with the compiled 'testRelease' classes.No dependencIEstestReleaseCompile - Classpath for compiling the testRelease sources.No dependencIEstestReleaseProvIDed - Classpath for only compiling the testRelease sources.No dependencIEstestReleaseWearapp - link to a wear app to embed for object 'testRelease'.No dependencIEstestWearapp - link to a wear app to embed for object 'test'.No dependencIEswearapp - link to a wear app to embed for object 'main'.No dependencIEsBUILD SUCCESSFulTotal time: 13.053 secsThis build Could be faster,please consIDer using the Gradle Daemon: https://docs.gradle.org/2.14.1/userguIDe/gradle_daemon.HTML@H_404_3@解决方法 感谢您编辑问题.由于有很多jar库,我们几乎不可能复制错误.所以,这里有一些尝试.由于您在添加com.androID.support:appcompat-v7:25.0.0 lib后出现错误,请执行以下 *** 作:
compile (compile 'com.androID.support:appcompat-v7:25.0.0') { exclude module: 'support-v4'}@H_404_3@查看它是否有效或错误是否发生变化
编辑:
您运行了以下命令:./ gradlew -q dependencIEs:dependencIEs –configuration compile
您可以在AndroID Studio终端中运行此命令,并在您的问题中发布deBUGApk和releaseApk依赖项.
命令(如果模块名称不同,则将应用程序更改为模块名称):
./gradlew app:dependencIEs@H_404_3@ 总结以上是内存溢出为你收集整理的android – Build在debug中运行,在release中失败 – ZipException重复条目全部内容,希望文章能够帮你解决android – Build在debug中运行,在release中失败 – ZipException重复条目所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
概述我正在将应用程序从2.3升级到Nougat(SDK 25).当我添加com. android.support:appcompat-v7:25.0.0以支持ActivityCompat.requestPermissions时.当我在调试模式下运行它时,应用程序运行没有问题,但使用./gradlew assembleDebug运行会导致以下错误: Error:Execution failed for 我正在将应用程序从2.3升级到Nougat(SDK 25).当我添加com. android.support:appcompat-v7:25.0.0以支持ActivityCompat.requestPermissions时.当我在调试模式下运行它时,应用程序运行没有问题,但使用./gradlew assembleDeBUG运行会导致以下错误:
赞
(0)
打赏
微信扫一扫
支付宝扫一扫
在android中创建聊天应用程序的最佳做法是什么
上一篇
2022-05-31
android – isMinifyEnabled()已弃用.有什么选择?
下一篇
2022-05-31
评论列表(0条)