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?
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