Why Gradle build is very slow for Android Studio?

gradle - Android Studio build too slow multidex application

  • When I add to my project the multidex:true, and make an Application class that extends from the MultiDexApplication, my project build time passed from 20 sec to around 90 sec.How to do some faster?

  • Answer:

    Supplying as an answer because this is better fit with the formatting. To simply answer your question: No, there is no way. Multidex is a process meant to help lift the burden of the 65k method limit. This process is complicated and will simply make your build times longer. The best you can can do is lower your method count. In your build.gradle (http://stackoverflow.com/questions/30104925/multidex-issue-execution-failed-for-task-appdexdebug) you're using: `compile 'com.google.android.gms:play-services:6.5.87'` But if you look at the most recent play services api you can pick and choose what services you actually need. Look at Table 1 http://developer.android.com/google/play-services/setup.html. Only use the ones you need. Google play services as a whole is somewhere around 30k methods. That should help.

VicVu at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

It depends. You haven't specified it in your question, but if you just want to speed-up your development builds - then you can avoid the extra work. Official documentation includes a http://developer.android.com/tools/building/multidex.html#dev-build about that.

Alex Lipov

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.