Configuration on demand is not supported by the current version of the Android Gradle plugin
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
This error means Gradle’s old configuration on demand optimization is enabled, but the Android Gradle Plugin does not support it in your build. The practical fix is usually simple: turn that feature off and, if you need build-speed improvements, use newer Gradle features such as configuration cache where your toolchain supports them.
What Configuration On Demand Was
Configuration on demand was an older Gradle optimization intended to avoid configuring every project in a large multi-module build. Instead, Gradle tried to configure only the projects required for the requested task.
That sounds attractive, but Android builds rely on complex cross-project wiring, generated tasks, and variant-aware configuration. Because of that, the Android Gradle Plugin has historically rejected or restricted this mode.
Where The Setting Usually Lives
The feature is commonly enabled in gradle.properties.
If that line is present, remove it or set it to false.
Then rerun the build.
Why The Android Plugin Complains
Android builds do more than compile one isolated module. The plugin wires together:
- build variants such as debug and release
- resource processing tasks
- manifest merging
- dependency resolution across modules
- generated source and packaging steps
Configuration on demand can skip or delay project configuration in ways that break those assumptions. The plugin therefore fails early instead of allowing subtle broken builds later.
Minimal Fix
The fastest path is:
- open
gradle.properties - disable configuration on demand
- sync the project again
From the command line, a clean build then looks like this:
If the error disappears, the root cause was just that unsupported property.
Better Modern Alternatives
If you were using configuration on demand for build speed, prefer supported improvements instead:
- configuration cache when your build is compatible with it
- build cache
- avoiding unnecessary task graph work
- cleaning up slow custom Gradle scripts
Those approaches are more aligned with current Gradle and Android plugin behavior than trying to force an older optimization flag.
Example gradle.properties
A safer project-level configuration might look like this:
The exact values vary by project, but the important part is that org.gradle.configureondemand is not enabled.
When The Error Appears Indirectly
Sometimes the property is not in your repository but in a global Gradle configuration under your home directory. If the project looks clean and the error persists, check user-level Gradle properties as well.
That matters on shared machines or after migrating from older Android projects.
Common Pitfalls
The most common mistake is trying to fix the problem by changing the Android Gradle Plugin version first. That can introduce unrelated compatibility issues when the real problem is just one unsupported property.
Another mistake is assuming configuration on demand is still the recommended path for Android build performance. It usually is not. Modern Gradle performance work has moved elsewhere.
A third issue is checking only the project-local gradle.properties and forgetting global Gradle settings under the user home directory.
Summary
- The error means
configuration on demandis enabled where the Android plugin does not support it. - Remove or disable
org.gradle.configureondemandin Gradle properties. - Android builds rely on project wiring that does not fit this older optimization mode well.
- Prefer newer supported performance features such as build cache and configuration cache.
- Check both project-level and user-level Gradle properties if the error persists.

