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

后端 未结 12 1274
南旧
南旧 2020-11-29 15:10

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

相关标签:
12条回答
  • 2020-11-29 15:29

    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

    0 讨论(0)
  • 2020-11-29 15:31

    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

    1. Open the Preferences window by clicking File > Settings (on Mac, Android Studio > Preferences).
    2. In the left pane, click Build, Execution, Deployment > Compiler.
    3. Un check the Configure on demand checkbox.
    4. Click Apply or OK.

    Check this Image for warning they have provided for specific Gradle plugin versions.

    0 讨论(0)
  • 2020-11-29 15:32

    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

    0 讨论(0)
  • 2020-11-29 15:33

    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.

    0 讨论(0)
  • 2020-11-29 15:37

    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
    0 讨论(0)
  • 2020-11-29 15:40

    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.

    0 讨论(0)
提交回复
热议问题