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

print

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

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 Android Gradle plugin since you are using Gradle version 4.6 or above. Suggestion: disable configuration on demand by setting org.gradle.configureondemand=false in your gradle.properties file or use a Gradle version less than 4.6.

No need to downgrade!

Disabling configure on demand requires two steps:

  1. Remove org.gradle.configureondemand from gradle.properties.
  2. 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

  1. In your project gradle.properties
  2. ${HOME}/.gradle/gradle.properties

Hope this helps 😀 #HappyCoding

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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.