升级到 Android Studio 3.1.2 后出现以下错误:
After upgrading to Android Studio 3.1.2 I am getting the following error:
当前版本的 Android Gradle 插件不支持按需配置,因为您使用的是 Gradle 版本 4.6 或更高版本.建议:通过在 gradle.properties 文件中设置 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 转到 Preferences > Build, Execution, Deployment > Compiler 并取消选中按需配置.
对于 Linux/Windows 转到 File > Settings > 构建、执行、部署 > 编译器 并取消选中按需配置.
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这篇关于当前版本的 Android Gradle 插件不支持按需配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 IncompIncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 Incompatible
如何在 gradle 中获取当前风味How to get current flavor in gradle(如何在 gradle 中获取当前风味)
如何修复“意外元素<查询>在“清单How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修复“意外元素lt;查询gt;在“清单中找到错误
基于 Android Gradle 中多风味库的多风味应用Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多风味库的多风味应用)
Android 依赖在编译和运行时有不同的版本Android dependency has different version for the compile and runtime(Android 依赖在编译和运行时有不同的版本)
本地 aar 库的传递依赖Transitive dependencies for local aar library(本地 aar 库的传递依赖)