After upgrading to Android Studio 3.1.2 I am getting the following error:
Configuration on demand is not supported by the current version of the Andro
The @wookupmaker answer is correct. But, if it still doesn't work, the problem migh be a global gradle.properties.
Even if I tried to override
org.gradle.configureondemand=false
in my local(project specific) gradle.properties, somehow it did not work.
After editing global (~/.gradle/gradle.properties) it worked as expected
It is already known bug in Android studio even in the Documentation, They have mentioned about this Problem.
The easiest way right now is to disable this feature by going
Check this Image for warning they have provided for specific Gradle plugin versions.
Invalidate cache and restart/disabling configure on demand did not work for me. The only solution that helped me is to import the project from git again.
[UPD] Need to change "com.android.tools.build:gradle" from 3.1.2 to 3.1.1
In Android Studio, just go to File -> Settings -> Build, Execution, Deployment -> Compiler and click to uncheck the configure on demand option, then click Ok and Sync Project with gradle files again.
Remove org.gradle.configureondemand
from gradle.properties.
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
gradle.properties
${HOME}/.gradle/gradle.properties
All I needed to do in this case was to use "nuclear function" in Android Studio:
File -> Invalidate Caches / Restart....
Like in many other cases, this helped to make Gradle sync and project build working again. I'm using gradle-4.6-all
and Gradle Plugin com.android.tools.build:gradle:3.1.3
.