当前版本的 Android Gradle 插件不支持按需配置

Configuration on demand is not supported by the current version of the Android Gradle plugin(当前版本的 Android Gradle 插件不支持按需配置)
本文介绍了当前版本的 Android Gradle 插件不支持按需配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

升级到 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.

推荐答案

无需降级!

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

  1. 从 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文件

  1. 在你的项目中gradle.properties
  2. ${HOME}/.gradle/gradle.properties

这篇关于当前版本的 Android Gradle 插件不支持按需配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
cocos2d-android: how to display score(cocos2d-android:如何显示分数)
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
Android file copy(安卓文件拷贝)
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)