来自 Wild 的 Resources$NotFoundException 报告

发布于 2024-12-10 17:27:43 字数 1562 浏览 0 评论 0原文

我刚刚发布了一个更新,并在有人更新了以前工作的应用程序后从野外收到了异常报告。

相同的代码可以在我的手机上运行,​​资源是原始文件,不依赖于设备、本地依赖或任何东西。

我之前在开发更新时发生过类似的事情,我清理了项目并解决了它。

然而,这似乎不是一个好的解决方案,因为我无法验证修复,不想只是推出一个版本以防它解决问题。

任何有关原因或解决方案的建议将不胜感激!

堆栈跟踪如下:

java.lang.RuntimeException: Unable to create service com.beltane.apppro.TickerService:  
android.content.res.Resources$NotFoundException: Resource ID #0x7f040005 at 
android.app.ActivityThread.handleCreateService(ActivityThread.java:2969) at 
android.app.ActivityThread.access$3300(ActivityThread.java:125) at  
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087) at 
android.os.Handler.dispatchMessage(Handler.java:99) at 
android.os.Looper.loop(Looper.java:123) at  
android.app.ActivityThread.main(ActivityThread.java:4627) 
at java.lang.reflect.Method.invokeNative(Native Method) at  
java.lang.reflect.Method.invoke(Method.java:521) at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) at  
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at
dalvik.system.NativeStart.main(Native Method) Caused by:    
android.content.res.Resources$NotFoundException: Resource ID #0x7f040005 at 
android.content.res.Resources.getValue(Resources.java:892) at   
android.content.res.Resources.openRawResourceFd(Resources.java:854) at 
android.media.MediaPlayer.create(MediaPlayer.java:647) at   
com.beltane.apppro.TickerService.onCreate(TickerService.java:42) at 
android.app.ActivityThread.handleCreateService(ActivityThread.java:2959) ... 10 more

I just released an update and got an exception report from the wild after someone updated a previously working application.

The same code works on my phone, the resource is a raw file and not dependent on device, local dependent or anything.

I had a similar thing happen before while developing the update, I cleaned the project and it resolved it.

However this doesn't seem to be a good solution as I cannot verify the fix, don't want to just shove a version out in case it fixes the issue.

Any advice as to cause or resolution would be massively appreciated!

Stack Trace below:

java.lang.RuntimeException: Unable to create service com.beltane.apppro.TickerService:  
android.content.res.Resources$NotFoundException: Resource ID #0x7f040005 at 
android.app.ActivityThread.handleCreateService(ActivityThread.java:2969) at 
android.app.ActivityThread.access$3300(ActivityThread.java:125) at  
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087) at 
android.os.Handler.dispatchMessage(Handler.java:99) at 
android.os.Looper.loop(Looper.java:123) at  
android.app.ActivityThread.main(ActivityThread.java:4627) 
at java.lang.reflect.Method.invokeNative(Native Method) at  
java.lang.reflect.Method.invoke(Method.java:521) at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) at  
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at
dalvik.system.NativeStart.main(Native Method) Caused by:    
android.content.res.Resources$NotFoundException: Resource ID #0x7f040005 at 
android.content.res.Resources.getValue(Resources.java:892) at   
android.content.res.Resources.openRawResourceFd(Resources.java:854) at 
android.media.MediaPlayer.create(MediaPlayer.java:647) at   
com.beltane.apppro.TickerService.onCreate(TickerService.java:42) at 
android.app.ActivityThread.handleCreateService(ActivityThread.java:2959) ... 10 more

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

榕城若虚 2024-12-17 17:27:43

对于任何面临类似问题的人,我的解决方案非常可怕:

准备一个新版本,删除所有中间生成的文件,进行干净的构建并重新发布。

我将所有媒体播放器创建代码捕获在 try catch 块中,以获取未找到资源的异常,并弹出一个 toast,向用户解释发生了什么并联系解决方案。

这非常令人讨厌,但考虑到这种情况永远不会发生...

我还没有从返回崩溃报告的用户那里听到任何一种方式,此后我得到了其他很好的反馈,如果我进一步听到任何一种方式,我都会更新。

For anyone facing a similar problem my resolution as horrible as it is:

Prepare a new release deleting all intermediate generated files, doing a clean build and re-releasing.

I trapped all media player creation code in try catch blocks for resource not found exceptions and pop up a toast explaining to the user what has occurred and to contact for a resolution.

This is pretty nasty but given that this should never occur...

I haven't heard either way from the user that returned the crash report, I have had other good feedback since, I'll update if I hear further either way.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文