Error:execution failed for task ': App:dexdebug '. > com.android.ide.common.process.ProcessException

Source: Internet
Author: User

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

Cause of Error:

This exception occurs when Android studio compiles, because a duplicate jar package is referenced in the project, possibly because the newly introduced library module has a jar package that is repeatedly referenced in the master project and needs to focus on the Android Compatibility Pack Support-v4 and support-v7 packages, there are some commonly used open source projects, such as gson,nineoldandroids ..., these commonly used open source projects may have been referenced in the library project you quoted.

Workaround:

To solve this problem we just need to delete the Libs folder in the main project and the duplicate part of the library, and I recommend that you change the habit of putting the jar package in the Libs directory, and build it using Gradle, under Module . The Gradle directory will

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

Or

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

Switch

{    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 ' is referenced in both the main project and the library project, but I am in the latest Android Studio 1.3 Preview and Gradle 2.3 In the main project and the Library project did a simulation, but did not appear the exception, according to the issue of the Build.gradle file, which may be because of the use of the low version of Android Studio or Gradle, so it is best to check the project , the jar,library that have been introduced in the library project will not be introduced into the main project.

Reference Links:

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

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Error:execution failed for task ': App:dexdebug '. > com.android.ide.common.process.ProcessException

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.