Error: Execution failed for task & #39;: app: dexDebug & #39;. & gt; com. android. ide. common. process. ProcessException,

Source: Internet
Author: User

Error: Execution failed for task': app: dexdebug'.> com. android. ide. common. process. ProcessException,
Exception Log:

Error: Execution failed for task': app: dexdebug '.
> Com. android. ide. common. process. ProcessException: org. gradle. process. internal. ExecException: Process 'command'/Library /...... /Java "finished with non-zero exit value 2

Error cause:

This exception occurs during Android Studio compilation and running, because duplicate jar packages are referenced in the project. This may be because the newly introduced library module has a jar package that is repeatedly referenced in the main project, android compatibility package needs to be checkedSupport-v4AndSupport-v7Package, and some common open-source projects, such as Gson, Nineoldandroids ..., These common open-source projects may have been referenced in the library project you have referenced.

Solution:

To solve this problem, we only need to delete the main projectLibsIn the folder and in the library, I recommend that you change the habit of placing the jar package in the libs directory and use Gradle to build it.Build. gradleUnder

dependencies {    compile files('libs/nineoldandroids-2.4.0.jar')}

Or

dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])}

Change

dependencies {    compile 'com.nineoldandroids:library:2.4.0'}

In the reference Link, I found a similar exception

Error: Execution failed for task': app: dexdebug '.
> Com. android. ide. common. internal. LoggedErrorException

This error occurs because compile 'com. nineoldandroids: library: 2.4.0 ', but I simulated the main project and Library Project in the latest Android Studio 1.3 Preview and Gradle 2.3, but this exception did not occur, build is provided according to the problem. gradle file. This may be because Android Studio or Gradle is used in earlier versions. Therefore, you 'd better check the jar file already introduced in the library project in the project, the library should not be introduced into the main project.

Reference link:

Http://stackoverflow.com/questions/27675717/gradle-error-execution-failed-for-task-appdexdebug/27675841

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.