错误:
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.
解决:
在gradle.properties中设置configureondemand=false
如果设置之后,仍然报错:
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.
解决方法:在"File" - "Setting" - "Build, Execution, Deployment" - "Compiler"中的 Configure on demand 取消勾选

本文解决了一个常见的Android开发问题,当使用Gradle 4.6及以上版本时,配置按需加载不被支持。提供了两种解决方案,一是在gradle.properties文件中设置configureondemand=false,二是取消勾选IDE中的Configureondemand选项。
748

被折叠的 条评论
为什么被折叠?



