title: :app:dexDebug ExecException finished with non-zero exit value 2
body: <p>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. </p>
  
  <p>Error:Execution failed for task ':app:dexDebug'.</p>
  
  <blockquote>
    <p>com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2</p>
  </blockquote>
  
  <p>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.
  <a href="https://stackoverflow.com/questions/23318109/is-it-possible-to-use-java-8-for-android-development">Is it possible to use Java 8 for Android development?</a></p>
  
  <p>I have looked through numerous similar question but none works for me. Some similar issues found on stack were</p>
  
  <p><a href="https://stackoverflow.com/questions/28957412/why-java-exe-exit-with-value-1-in-android-studio/29236320#">why java.exe exit with value 1 in android studio</a></p>
  
  <p><a href="https://stackoverflow.com/questions/29747363/errorexecution-failed-for-task-appdexdebug-comcommand-finished-with-non">Error:Execution failed for task &#39;:app:dexDebug&#39;. &gt; comcommand finished with non-zero exit value 2</a></p>
  
  <p><a href="https://stackoverflow.com/questions/29756188/java-finished-with-non-zero-exit-value-2-android-gradle">Java finished with non-zero exit value 2 - Android Gradle</a></p>
  
  <p><a href="https://stackoverflow.com/questions/29998783/java-exe-finished-with-non-zero-exit-value-2-after-upgrading-play-service">java.exe finished with non-zero exit value 2</a></p>
  
  <p><a href="https://stackoverflow.com/questions/29837352/process-command-c-program-files-java-jdk1-8-0-31-bin-java-exe-fi">Process &#39;command&#39; C: \ Program Files \ Java \ jdk1.8.0_31 \ bin \ java.exe &#39;&#39; finished with a non -zero exit value 2</a></p>
  
  <p>I have looked through dependencies in gradle built to see if there were any conflict but found none.</p>
  
  <p>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.</p>