com.android.builder.errors.EvalIssueException: The option ‘android.enableAapt2‘ is deprecated.

Build file 'D:\AndroidDemo\Mp4ToCamera\app\build.gradle' line: 2

An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
   > com.android.builder.errors.EvalIssueException: The option 'android.enableAapt2' is deprecated.
     The current default is 'true'.
     It has been removed from the current version of the Android Gradle plugin.
     This property has no effect, AAPT2 is now always used.

新建的一个项目,运行时出现如上所示错误,翻译过来是enableAapt2在当前Android Gradle插件中删除,此属性无效,现在始终使用AAPT2

解决方法:

到项目级build.gradle中修改gradle的版本为3.4.0:

原始代码:

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.2"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

修改后:

我通常都是修改为3.4.0可以正常运行,修改为3.4.0后点击右上角sync Now同步一下。

最后再重新安装一下即可

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值