这篇是应为看见有人查看处理方法要付钱恶心到了才发的,我不希望互联网成为付联网 ,如果以后所以代码或所以解决问题的方法都需要付费才能看我觉得这是对互联网的侮辱和破坏,会限制其发展

一、问题

android studio升级到Gradle 7.0后出现的问题

A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
   > The option 'android.enableBuildCache' is deprecated.
     The current default is 'false'.
     It was removed in version 7.0 of the Android Gradle plugin.
     The Android-specific build caches were superseded by the Gradle build cache (https://docs.gradle.org/current/userguide/build_cache.html).

二、解决方法

去项目里找到gradle.properties文件,把 android.enableBuildCache=true 和 android.buildCacheDir=./build/buildCache/注销掉,原因不知,亲测有效,代码如下:

#Wed Feb 26 13:11:31 CST 2020
android.enableJetifier=true
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
#android.buildCacheDir=./build/buildCache/
android.useAndroidX=true
android.enableD8=true
#android.enableBuildCache=true

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐