4

Our app on Google Play market has a weird exception being thrown on some devices. I see the following stack trace:

android.content.res.Resources$NotFoundException: File res/anim/ani_in_fade.xml from xml type anim resource ID #0x7f040000
   at android.content.res.Resources.loadXmlResourceParser(Resources.java:2185)
   at android.content.res.Resources.loadXmlResourceParser(Resources.java:2140)
   at android.content.res.Resources.getAnimation(Resources.java:894)
   at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:71)
   ....

Basically, all the animations are in place in the res/anim folder. Most of the devices load and display them without a problem.

Any ideas what may be the reason for this? One of the ideas I have is that activity is being (or has been) destroyed at the point we try to load the resource, however the context is not null at that point of time...

Thanks,

4

1 回答 1

3

Just in case anyone hits this problem... You need to update your proguard.cfg file and add the following lines:

-keepclassmembers class **.R$* {
       public static <fields>; 
}
于 2013-01-28T22:19:28.863 回答