Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
414 views
in Technique[技术] by (71.8m points)

java - :app:dexDebug ExecException finished with non-zero exit value 2

Could anyone help me out with the following error. When i clean the project, it doesn't show any error but every time i try to run i get this message.

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:Program FilesJavajdk1.8.0_45injava.exe'' finished with non-zero exit value 2

The application was running with no errors but as my system crashed and restarted android studio i had few updates for Android API 22. After the update the application keep giving me this error message. I downloaded JDK 8 and tried to run but didn't work. Later i downgraded to JDK 7 after this stack post but still has not fixed it. Is it possible to use Java 8 for Android development?

I have looked through numerous similar question but none works for me. Some similar issues found on stack were

why java.exe exit with value 1 in android studio

Error:Execution failed for task ':app:dexDebug'. > comcommand finished with non-zero exit value 2

Java finished with non-zero exit value 2 - Android Gradle

java.exe finished with non-zero exit value 2

Process 'command' C: Program Files Java jdk1.8.0_31 bin java.exe '' finished with a non -zero exit value 2

I have looked through dependencies in gradle built to see if there were any conflict but found none.

I even tried to copy the code into a new project and run it but still no success. Anyone who has faced the same issue and solved it please help me out.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After days of trying out finally could fix the issue. The problem with one of my .jar files. I had to remove each jar and check one by one until i found it. I removed the .jar file and cleaned my project and ran successfully. If any one should face similar issue check your jar file one by one.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...