很遗憾,您的应用已停止工作

时间:2016-09-16 06:00:46

标签: java android crash

我制作了一个最低API等级为18的应用,但它的内容如下:

  

不幸的是,您的应用已停止

在android 4.4 Emulator中运行但在6.0模拟器上运行完美。

  

09-16 01:51:20.995 2579-2579 / com.neupane.kugeclass E / AndroidRuntime:致命异常:主要                                                                        过程:com.neupane.kugeclass,PID:2579                                                                        android.content.res.Resources $ NotFoundException:资源ID#0x7f020055                                                                            在android.content.res.Resources.getValue(Resources.java:1123)                                                                            在android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:321)                                                                            在android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)                                                                            在android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:192)                                                                            在android.support.v7.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:421)                                                                            在android.support.v7.view.menu.ActionMenuItemView.initialize(ActionMenuItemView.java:114)                                                                            在android.support.v7.widget.ActionMenuPresenter.bindItemView(ActionMenuPresenter.java:206)                                                                            在android.support.v7.view.menu.BaseMenuPresenter.getItemView(BaseMenuPresenter.java:182)                                                                            在android.support.v7.widget.ActionMenuPresenter.getItemView(ActionMenuPresenter.java:192)                                                                            在android.support.v7.widget.ActionMenuPresenter.flagActionItems(ActionMenuPresenter.java:451)                                                                            在android.support.v7.view.menu.MenuBuilder.flagActionItems(MenuBuilder.java:1138)                                                                            在android.support.v7.view.menu.BaseMenuPresenter.updateMenuView(BaseMenuPresenter.java:91)                                                                            在android.support.v7.widget.ActionMenuPresenter.updateMenuView(ActionMenuPresenter.java:229)                                                                            在android.support.v7.view.menu.MenuBuilder.dispatchPresenterUpdate(MenuBuilder.java:284)                                                                            在android.support.v7.view.menu.MenuBuilder.onItemsChanged(MenuBuilder.java:1030)                                                                            在android.support.v7.view.menu.MenuBuilder.startDispatchingItemsChanged(MenuBuilder.java:1053)                                                                            在android.support.v7.app.ToolbarActionBar.populateOptionsMenu(ToolbarActionBar.java:460)                                                                            在android.support.v7.app.ToolbarActionBar $ 1.run(ToolbarActionBar.java:61)                                                                            在android.os.Handler.handleCallback(Handler.java:733)                                                                            在android.os.Handler.dispatchMessage(Handler.java:95)                                                                            在android.os.Looper.loop(Looper.java:136)                                                                            在android.app.ActivityThread.main(ActivityThread.java:5017)                                                                            at java.lang.reflect.Method.invokeNative(Native Method)                                                                            在java.lang.reflect.Method.invoke(Method.java:515)                                                                            在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:779)                                                                            在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)                                                                            在dalvik.system.NativeStart.main(本地方法)

1 个答案:

答案 0 :(得分:1)

只需检查您放置drawables的文件夹。错误的是你把drawables-v21文件夹放在了21以下的地方。这就是为什么它在棉花糖上工作但不在kitkat上工作。系统没有找到资源。检查一次,让我知道