简体   繁体   English

这是什么资源,为什么Android找不到它?

[英]What is this resource and why can't Android find it?

Hey, Sorry if this is a dumb question. 嘿,抱歉,这是一个愚蠢的问题。 I'm an amateur programmer and new to Android, though I've prided myself on not having to bother anyone for help until this point. 我是一名业余程序员,并且是Android的新手,尽管我以自己不必在此之前麻烦任何人而感到自豪。

The problem I'm having is that my program randomly seems to hang on startup. 我遇到的问题是我的程序在启动时似乎随机挂起。 It doesn't happen all the time, and when does happen, it sometimes unfreezes within several seconds. 它不会一直发生,并且一旦发生,有时会在几秒钟内冻结。 I haven't been able to see any pattern to the crashing. 我还没看到崩溃的任何模式。

I've looked at several LogCats and this seems to be the key error, as it always throws before I run the program (sometimes twice), freeze or no: 我看过几个LogCat,这似乎是关键错误,因为它总是在运行程序之前抛出(有时两次),冻结或否:

Failure getting entry for 0x7f03001c (t=2 e=28) in package 0: 0xffffffb5
updateAppWidget couldn't find any view, using error view
android.content.res.Resources$NotFoundException: Resource ID #0x7f03001c
    at android.content.res.Resources.getValue(Resources.java:891)
    at android.content.res.Resources.loadXmlResourceParser(Resources.java:1865)
    at android.content.res.Resources.getLayout(Resources.java:730)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
    at android.widget.RemoteViews.apply(RemoteViews.java:900)
    at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java:209)
    at android.appwidget.AppWidgetHost.updateAppWidgetView(AppWidgetHost.java:243)
    at android.appwidget.AppWidgetHost$UpdateHandler.handleMessage(AppWidgetHost.java:72)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:4425)
    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:860)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    at dalvik.system.NativeStart.main(Native Method)
showStatusIcon on inactive InputConnection

I'm working in Eclipse with the Android-plug-in. 我正在使用Android插件在Eclipse中工作。 Tried searching for that string 0x7f03001c, but can't find it in my generated R file or anywhere. 尝试搜索该字符串0x7f03001c,但无法在我生成的R文件或任何其他位置找到它。 I'm not using any XML, or at least I still get this error when I skip the parts that do use it, so I have no idea where these errors are coming from. 我没有使用任何XML,或者至少当我跳过使用XML的部件时仍然收到此错误,所以我不知道这些错误的来源。

Lastly, I think this has only started recently, though since I've been an idiot and haven't been doing version control (hopefully learnt my lesson, this time) I don't see how to test whether it's even coming from my code, or not. 最后,我认为这只是最近才开始的,尽管自从我成为白痴并且没有进行版本控制(希望这次学习了教训)之后,我看不到如何测试它是否来自我的代码, 或不。

Thanks in advance for any responses. 预先感谢您的任何回复。

-Sam -山姆

There isn't much to go on, but there are two methods I would use to find it. 没什么要继续的,但是有两种方法可以找到它。

One - step through the code, line-by-line to identify if you can repeat this error reliably around a part of the code 一步步地遍历代码,以确定是否可以可靠地在部分代码周围重复此错误

Two - it looks like you're using an object based on a resource that isn't loading properly - check the most recent resources to insure they're what you AND the API are expecting. 两种-似乎您使用的是基于未正确加载的资源的对象-请检查最新资源以确保它们符合您和API的期望。 Try taking out the code that is using resources one-line-at-a-time. 尝试一次一行地取出正在使用资源的代码。

Of course, you already said version control would be helpful :-) 当然,您已经说过版本控制会有所帮助:-)

Do you have any calls to updateAppWidget ? 您有电话要updateAppWidget吗? If not, it's probably not your code. 如果没有,那可能不是您的代码。

In that case, try to use a brand new simulator and see if your app will launch. 在这种情况下,请尝试使用全新的模拟器,然后查看您的应用是否将启动。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM