7

In the most recent update of Android Studio (v 0.5.7), the option "configure-on-demand" is used by default for gradle builds. This is causing a problem in my current project build. When I try to sync my project with gradle files in Android Studio, I get the following error:

Error:A problem occurred configuring project ':PROJECT_NAME'. Configuration with name 'default' not found.

However everything works fine when I build using command line without the "configure-on-demand" flag.

I tried disabling it by putting "org.gradle.configureondemand=false" in my gradle.properties but it seems that Android Studio doesn't respect this. I still get the same error and the gradle logs show:

Configuration on demand is an incubating feature

Is there a way to disable this in Android Studio ?

aarkay
  • 191
  • 1
  • 7
  • What are you doing in your build files that it's necessary to disable configure on demand? – Scott Barta May 09 '14 at 00:24
  • @ScottBarta I have the following top level directories: **project/module, base** and project:module is a dependency for base. The issue goes away if I remove this dependency. – aarkay May 09 '14 at 04:59
  • 1
    I don't understand that explanation at all. "Configuration with name 'default' not found" is due to an error in your build files, where you've pointed it at a module that doesn't actually exist. Disabling configure on demand almost certainly isn't the right solution. – Scott Barta May 09 '14 at 15:48
  • 1
    do you really get an "error" regarding ```Configuration on demand is an incubating feature.```? I don't see this but I can confirm that there is somewhat a "warning" in front of each build. But back to you problem: is it answered by http://stackoverflow.com/questions/17188489 ? – childno͡.de Dec 10 '14 at 19:12
  • answered in http://stackoverflow.com/questions/23991988/android-studio-0-5-9-2-annoying-gradle-warnings – Paul Verest Mar 13 '15 at 10:11

1 Answers1

12

For Android Studio 1.5.1 - 3.1.3: Go to File > Settings > Build, Execution, Deployment > Compiler and turn off "Configure on demand".

Damnum
  • 1,839
  • 16
  • 35