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