Error: style attribute '@android:attr/windowExitAnimation' not found

做~自己de王妃 提交于 2019-12-03 00:01:30

All the problem was solved already.

Cause of the problem:

There are two modules, A_module, B_module.

B_module has a style:

<style name="my_style”> 
 <item 
  name="@android:windowEnterAnimation">@anim/anim_toast_show</item> 
 <item 
 name="@android:windowExitAnimation">@anim/anim_toast_hide</item>
</style>

If B_module compile(':A_module')
Build or Clean, report a error location in A_module->Res->values->styles:

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

Solution:
Removing the "@" at the start of the item name.

<item name="@android:windowEnterAnimation">@anim/anim_toast_show</item>
<item name="@android:windowExitAnimation">@anim/anim_toast_hide</item>

to:

<item name="android:windowEnterAnimation">@anim/anim_toast_show</item>
<item name="android:windowExitAnimation">@anim/anim_toast_hide</item>
Арсен Азизов

Setting android.enableAapt2=false in the gradle.properties file fixes this issue. See the Stack Overflow question I linked.

It will help you!

Removing a custom attribute

I got a similar error when I deleted an attribute for a custom view. The reason the error came up was that I still had xml references to it in my project.

Pressing Ctrl + Shift + F to search the entire project for the offending attribute and then removing all references to it solved the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!