Error:execution failed for task ': App:dexdebug '. > com.android.ide.common.process.ProcessException
Source: Internet
Author: User
<span id="Label3"></p>Exception log: <blockquote> <blockquote> <p>Error:execution failed for task ': App:dexdebug '.<br>> com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process ' command ' /library/....../java "finished with Non-zero exit value 2</p> </blockquote> </blockquote>Cause of Error:<p><p>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 <strong> Support-v4</strong> and <strong>support-v7</strong> 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.</p></p>Workaround:<p><p>To solve this problem we just need to delete the <strong>Libs</strong> 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 <strong>. The Gradle</strong> directory will</p></p><pre name="code" class="prettyprint"><pre name="code" class="prettyprint"><code class="language-Groovy hljs livecodeserver has-numbering">dependencies { <span class="hljs-built_in">files(<span class="hljs-string">‘libs/nineoldandroids-2.4.0.jar‘)}</span></span></code></pre></pre> <ul class="pre-numbering"> <ul class="pre-numbering"> <li>1</li> <li>2</li> <li>3</li> </ul> </ul><p><p>Or</p></p><pre name="code" class="prettyprint"><pre name="code" class="prettyprint"><code class="language-Groovy hljs rust has-numbering">dependencies { compile fileTree(<span class="hljs-keyword">dir: <span class="hljs-string">‘libs‘, include: [<span class="hljs-string">‘*.jar‘])}</span></span></span></code></pre></pre> <ul class="pre-numbering"> <ul class="pre-numbering"> <li>1</li> <li>2</li> <li>3</li> </ul> </ul><p><p>Switch</p></p><pre name="code" class="prettyprint"><pre name="code" class="prettyprint"><code class="language-Groovy hljs matlab has-numbering"><span class="hljs-cell">{ compile <span class="hljs-string">‘com.nineoldandroids:library:2.4.0‘}</span></span></code></pre></pre> <ul class="pre-numbering"> <ul class="pre-numbering"> <li>1</li> <li>2</li> <li>3</li> </ul> </ul><p><p>In the reference link, I found a similar exception</p></p> <blockquote> <blockquote> <p>Error:execution failed for task ': App:dexdebug '.<br>> com.android.ide.common.internal.LoggedErrorException</p> </blockquote> </blockquote><p><p>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.</p></p>Reference Links:<p><p>http://stackoverflow.com/questions/27675717/gradle-error-execution-failed-for-task-appdexdebug/27675841</p></p><p><p>Error:execution failed for task ': App:dexdebug '. > com.android.ide.common.process.ProcessException</p></p></span>
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