Android studio build failed with the following error

Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 2 

Tried this answer

but my problem is still not resolved. How can I solve this problem?

+5
source share
2 answers

Try enabling MultiDex to fix the 65k method error by adding this to your build.gradle file

 defaultConfig { multiDexEnabled true } 

Also check the use of duplicate libraries (sometimes multiple libraries use the same dependency as support-v4)

+4
source

This error may occur if some of your jar files are not compiled. You must enter your build.gradle file in your project and look in your dependencies.

If you just import some jar files, you can try to delete them and add them one at a time. This will help you determine which one is causing the error.

In my case, I did just that, and when I imported the latter, the application was compiled. So I think the real problem was that I imported too much at once. But now everything works.

Another possible error question is its errors, clean gradle before assembly

0
source

All Articles