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:
在最近更新的Android Studio (v0.5.7)中,默認為gradle構建使用“configure-按需配置”選項。這在我當前的項目構建中造成了一個問題。當我嘗試將我的項目與Android Studio中的gradle文件同步時,我得到了以下錯誤:
Error:A problem occurred configuring project ':PROJECT_NAME'. Configuration with name 'default' not found.
錯誤:配置項目':PROJECT_NAME'出現了一個問題。未找到名稱為“default”的配置。
However everything works fine when I build using command line without the "configure-on-demand" flag.
然而,當我使用命令行構建而不使用“configure- demand”標志時,一切都很正常。
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:
我嘗試用“org.gradle”來禁用它。在我gradle configureondemand = false”。但似乎Android Studio並不尊重這一點。我仍然會得到相同的錯誤,而gradle日志顯示:
Configuration on demand is an incubating feature
按需配置是一種孵化特性
Is there a way to disable this in Android Studio ?
是否有辦法在Android Studio中禁用它?
1 个解决方案
#1
8
For Android Studio 1.5.1 - 3.1.3: Go to File > Settings > Build, Execution, Deployment > Compiler and turn off "Configure on demand".
對於Android Studio 1.5.1 - 3.1.3:去文件>設置>構建,執行,部署>編譯器,關閉“按需配置”。