Android Studio 4.1.2 Build Error

  1. 最近升级了Android Studio 4.1.2 发现了一个比较特殊的问题。
Android-Studio-Version.jpg
  1. 第一次编译会出现如下的错误,但是再次编译又可以正常编译了。
    An exception occurred applying plugin request [id: 'com.android.application']

Failed to apply plugin [id 'com.android.internal.application']
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.

Android-Studio-Build-Error.jpg
  1. 网上提示可以通过升级Gradle Version 到 5.6.1, 但是实际没有效果


    Android-Studio-Gradle_Version.jpg
  2. 解决方法:
    在 提示中 The option 'android.enableAapt2' is deprecated.
    在 gradle.properties文件中
    注释:android.enableAapt2=false

Android-Studio-Fixed_Bug.jpg
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容