Why Configuration on demand is not supported by the current version of the Gradle plugin?

alessandro candolini picture alessandro candolini · May 3, 2018 · Viewed 8.4k times · Source

Configuration on demand is not supported by version 3.1.2 of the Android Gradle plugin when using Gradle version 4.6 or above.

gradle Configuration on demand was pretty useful when working with multi-module android projects with lots of modules, to avoid unnecessary configuration.

I cannot find official release notes/documentation that explains the reason why configuration on demand is not supported by the latest android plugin. Does anyone have a better understanding of why it does not work and maybe what are the plans for the future? (eg, is this just a temporary bug?) is there any official documentation about this change?

Answer

Mostafa Pirhayati picture Mostafa Pirhayati · May 14, 2018

First Remove org.gradle.configureondemand from gradle.properties.

then In Android Studio, For Mac go to the Preferences > Build, Execution, Deployment > Compiler and uncheck the configure on demand. For Linux/Windows go to the File > Settings > Build, Execution, Deployment > Compiler and uncheck the configure on demand.

Note, there are 2 gradle.properties files

In your project gradle.properties ~/.gradle/gragle.properties