解决AS 3.0 版本 style attribute '

作者: 工藤一号 | 来源:发表于2017-10-26 14:08 被阅读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
    

    至此问题暂时解决。

    相关文章

      网友评论

        本文标题:解决AS 3.0 版本 style attribute '

        本文链接:https://www.haomeiwen.com/subject/fyqkpxtx.html