3
gradle clean assembleDebug

It takes around 2 minutes to build and it uses 100% CPU blocking everything until the build ends. It happens from command line and from android studio as well. both installed version or gradle wrapper.

It's extremely frustrating. Need help.

this didn't work

Update

gradle version 2.7

gradlew version 2.8

android studio version 1.5.1

Community
  • 1
  • 1
Manza
  • 3,427
  • 4
  • 36
  • 57
  • Please say exactly which versions of Android Studio and Gradle you are using. Also please say if you are using the gradle wrapper (gradlew) or some other standalone version of gradle. – Doug Stevenson Feb 22 '16 at 22:48
  • You can't be using both gradle and gradlew at the same time. gradlew will download the version of gradle mentioned in your .gradle directory. Consider using *only* gradlew (recommended), and bump your gradlew version to 2.11. There are lots of speed improvements. – Doug Stevenson Feb 22 '16 at 23:16

1 Answers1

0

The problem occoured during the execution of:

transformClassesWithDexForDebug

Solved by adding

defaultConfig {
...
    multiDexEnabled true

}

to build.gradle

Manza
  • 3,427
  • 4
  • 36
  • 57
  • Wow this is so drastic. It may have fixed the issue, but it has other consequences; see here - https://stackoverflow.com/questions/33588459/what-is-android-multidex and see the official docs - https://developer.android.com/studio/build/multidex.html – milosmns Sep 25 '17 at 15:05