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

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


The reason why configuration on demand has been "removed" is to avoid unpredictable build error.

You still use gradle 4.4 though.

See Known issue about Android Studio

Configuration on demand with Gradle 4.6: If you're using either Android Plugin for Gradle 3.0.1 or 3.1.0 with Gradle 4.6, you should disable configuration on demand in your gradle.properties file, as shown below, to avoid some unpredictable build errors. This issue should be fixed in a future version of the plugin.

org.gradle.configureondemand=false