热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Android编译报Runwithstacktraceoptiontogetthestacktrace

Android编译报Runwith--stacktraceoptiontogetthestacktrace,Go语言社区,Golang程序员人脉社

 Android开发在编译过程中经常会报类似如下的错误,突如其来经常会让我们不知所措。这时候最需要的就是静下心来,照着报错的提示排查问题。

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug77.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug80.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug81.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug82.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug79.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug74.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug73.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug76.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug75.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug78.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug17.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug26.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug25.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug12.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug8.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug21.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug4.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug5.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug27.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug22.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug14.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug30.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug31.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug13.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug18.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug9.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug28.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug10.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug15.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug1.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug2.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug19.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug6.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug23.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug11.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug16.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug29.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug3.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug24.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug7.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug20.jar, D:wsAutosizingTestappbuildintermediatestransformsdexBuilderdebug72.jar
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: com.google.gson.FieldAttributes

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
39 actionable tasks: 15 executed, 24 up-to-date

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.这句话是重点,但是说得不明不白的也不知道要怎么操作。

其实很简单,首先在Android Studio找到Terminal控制台(这个其实和CMD命令行控制台是一样的)

然后在控制台中输入如下指令,就可以重新编译debug版本,且带参数--stacktrace编译,如果编译失败会有失败的路径信息。

gradlew compileDebug --stacktrace

或者--info和--debug参数也用上会打印更多的log信息。

gradlew compileDebug --stacktrace --info --debug

推荐阅读
author-avatar
好开心6327
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有