解决AS 3.0 版本 style attribute '@android:attr/windowEnterAnimation' not found

10月26号,我在升级到AS 3.0正式版后,就更改了配置,以适应3.0的特性,遇到如下一个错误:

Error:(22, 5) style attribute '@android:attr/windowEnterAnimation' not found
Error:(22, 5) style attribute '@android:attr/windowExitAnimation' not found
Error:(31, 5) style attribute '@android:attr/windowEnterAnimation' not found
Error:(31, 5) style attribute '@android:attr/windowExitAnimation' not found

我查阅了google后,有大神说把android前面的@删掉就可以了,我试了一下,不行。
后来查阅发现,这是aapt2导致的,3.0默认启用了aapt2。
解决办法就是在project的根目录下的gradle.properties最后添加关闭aapt2的代码:

android.enableAapt2=false

至此问题暂时解决。

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

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,534评论 19 139
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,724评论 25 709
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,084评论 6 342
  • Gradle plugin 3.0 & Android Studio 3.0 我们主要讲一下升级gradle pl...
    coofee阅读 18,603评论 6 17
  • 早晨门口的电线杆旁边停着一辆破旧的自行车。 自行车后座上一边吊了一只鼓鼓囊囊的蛇皮袋,不知里面都装了些什么?蛇皮袋...
    六月荷清香阅读 3,085评论 0 8