Android Studio 3.0 升级 Error:(2638) error: style attribute ‘@android:attr/windowEnterAnimation’ not found.

作者: android 发布时间: 2017-11-02 浏览: 14698 次 编辑

Android Studio 升级到了3.0 出现下面的错误

error: style attribute '@android:attr/windowEnterAnimation' not found.

注意:提示我们找不到@android:attr/windowEnterAnimation,因为已经不支持@开头使用android自带的属性,我们只要把@符号删掉就可以了。

Android Studio3.0 以前代码如下:

<style name="toast_anim_view">
    <item name="@android:windowEnterAnimation">@anim/toast_anim_in</item>
    <item name="@android:windowExitAnimation">@anim/toast_anim_out</item>
</style>

Android Studio3.0 之后改成如下代码:

<style name="toast_anim_view">
    <item name="android:windowEnterAnimation">@anim/toast_anim_in</item>
    <item name="android:windowExitAnimation">@anim/toast_anim_out</item>
</style>