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

2023-02-02移动开发问题
14

本文介绍了当前版本的 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 插件不支持按需配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何在 COCOS2d Android 中使用 CClistview?
How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)...
2024-08-12 移动开发问题
5

cocos2d-android:如何显示分数
cocos2d-android: how to display score(cocos2d-android:如何显示分数)...
2024-08-11 移动开发问题
7

Sqlite 数据库未从资产文件夹 Android 复制
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)...
2024-04-15 移动开发问题
8

SQLite 数据库副本在由设备而不是模拟器生成时出现损坏
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)...
2024-04-15 移动开发问题
4

安卓文件拷贝
Android file copy(安卓文件拷贝)...
2024-04-15 移动开发问题
6

Android如何在android中检测Edittext的Copy事件
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)...
2024-04-15 移动开发问题
5