简体   繁体   English

资源$ NotFoundException尝试加载动画时

[英]Resources$NotFoundException when trying to load animation

Our app on Google Play market has a weird exception being thrown on some devices. 我们在Google Play市场上的应用程序在某些设备上引发了一个奇怪的例外。 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. 基本上,所有动画都在res / anim文件夹中。 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, 谢谢,

Just in case anyone hits this problem... You need to update your proguard.cfg file and add the following lines: 以防任何人遇到此问题...您需要更新您的proguard.cfg文件并添加以下行:

-keepclassmembers class **.R$* {
       public static <fields>; 
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试在 Android 上播放视频时出现 Resources$NotFoundException? - Resources$NotFoundException when trying to play a video on Android? 尝试访问测试资源时在 espresso 上获取 Resources$NotFoundException - Getting Resources$NotFoundException on espresso when trying to access test resources 框架动画因Resources $ NotFoundException而失败 - Frame Animation failing with Resources$NotFoundException 尝试从意图中提取数据时出现Resources $ NotFoundException - Resources$NotFoundException when trying to extract data from intent 尝试访问raw文件夹中的资源时,Robolectric抛出Resources $ NotFoundException - Robolectric throws Resources$NotFoundException when trying to access resource in raw folder 资源 - 访问文字时出现 NotFoundException - Resources - NotFoundException when accessing literals 启动 SplashScreen 时的 Resources$NotFoundException - Resources$NotFoundException when launching SplashScreen 尝试更改颜色时出现Resources $ NotFoundException - Resources$NotFoundException while trying to change color 尝试获取可绘制图像时出现android.content.res.Resources $ NotFoundException - android.content.res.Resources$NotFoundException when trying to get a drawable image 资源$ NotFoundException - Resources$NotFoundException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM