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