問題描述
升級到 Android Studio 3.1.2 后出現(xiàn)以下錯誤:
After upgrading to Android Studio 3.1.2 I am getting the following error:
當前版本的 Android Gradle 插件不支持按需配置,因為您使用的是 Gradle 版本 4.6 或更高版本.建議:通過在 gradle.properties 文件中設(shè)置 org.gradle.configureondemand=false 來禁用按需配置或使用低于 4.6 的 Gradle 版本.
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.
我嘗試按照建議進行操作,但這并沒有解決問題.有任何想法嗎?非常感謝所有幫助,謝謝.
I attempted following the suggestion but this did not fix the issue. Any ideas? All help is greatly appreciated, thank you.
推薦答案
無需降級!
禁用按需配置需要兩個步驟:
從 gradle.properties 中刪除
org.gradle.configureondemand
.
在 Android Studio 中,
對于 Mac 轉(zhuǎn)到 Preferences
> Build, Execution, Deployment
> Compiler
并取消選中按需配置.
對于 Linux/Windows 轉(zhuǎn)到 File
> Settings
> 構(gòu)建、執(zhí)行、部署
> 編譯器
并取消選中按需配置.
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.
注意,有2個gradle.properties
文件
- 在你的項目中
gradle.properties
${HOME}/.gradle/gradle.properties
這篇關(guān)于當前版本的 Android Gradle 插件不支持按需配置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!