Android开发Android知识Android技术知识

解决AS 3.0 版本 style attribute '

2017-10-26  本文已影响901人  工藤一号

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

至此问题暂时解决。

上一篇 下一篇

猜你喜欢

热点阅读