Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Have tried this answer

but my problem still not solved. How can i solve it?

like image 568
Harman Avatar asked Jul 02 '15 13:07

Harman


People also ask

How to fix Gradle sync failed in Android Studio?

Then open Android Studio and go to File > Settings > Build, Execution and Deployment > Gradle > Use Gradle from > Set the path of the downloaded Gradle. Step 4. Now try syncing the Gradle again and check if the error still persists.

How to enable build variant in Android Studio?

By default, Android Studio builds the debug version of your app, which is intended for use only during development, when you click Run. To change the build variant Android Studio uses, select Build > Select Build Variant in the menu bar.

How to make build in Android Studio?

In the Android menu, go to Build > Build Bundle(s) / APK (s) > Build APK(s). Android Studio will start building the APK for you. Once done, a pop-up on the bottom right will notify you of its completion.


1 Answers

Try to enable MultiDex to fix 65k methods error by adding this to your build.gradle

defaultConfig {
    multiDexEnabled true
}

Also check for duplicated libraries usage (sometimes multiple libraries use same dependency like support-v4)

like image 178
Ivan V Avatar answered Oct 08 '22 23:10

Ivan V