OGeek|极客世界-中国程序员成长平台

标题: android - 当前版本的 Android Gradle 插件不支持按需配置 [打印本页]

作者: 菜鸟教程小白    时间: 2022-8-1 01:19
标题: android - 当前版本的 Android Gradle 插件不支持按需配置

升级到 Android Studio 3.1.2 后,我收到以下错误:

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.



我尝试遵循该建议,但这并没有解决问题。有任何想法吗?非常感谢所有帮助,谢谢。



Best Answer-推荐答案


无需降级!

禁用按需配置需要两个步骤:

  • 删除 org.gradle.configureondemand来自 gradle.properties。
  • 在 Android Studio 中,
    对于 Mac 转至Preferences > Build, Execution, Deployment > Compiler并取消选中按需配置。
    对于 Linux/Windows 转至File > Settings > Build, Execution, Deployment > Compiler并取消选中按需配置。

  • 注意,有2个gradle.properties文件
  • 在您的项目中gradle.properties
  • ${HOME}/.gradle/gradle.properties
  • 关于android - 当前版本的 Android Gradle 插件不支持按需配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49990933/






    欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) Powered by Discuz! X3.4