当前位置:  开发笔记 > 编程语言 > 正文

应用程序在设备上以NullPointerException启动

如何解决《应用程序在设备上以NullPointerException启动》经验,为你挑选了1个好方法。

我做了一个新的构建(周末之后)和我的应用程序崩溃,下面的例外.有趣的是,我上周使用相同的配置进行了构建,没有任何代码更改,然后就可以了.该应用程序在模拟器上运行良好,但在我的三星Galaxy Tab 2 10.1抛出异常.我正在使用Android Studio 1.5.1.有人面临同样的问题吗?

12-21 14:19:27.359 6142-6142/? E/AndroidRuntime: FATAL EXCEPTION: main
                                             java.lang.NullPointerException
                                                 at android.view.View.getHardwareLayer(View.java:10225)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:2863)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
                                                 at android.view.View.getDisplayList(View.java:10462)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
                                                 at android.view.View.getDisplayList(View.java:10462)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
                                                 at android.view.View.draw(View.java:11028)
                                                 at android.view.View.getDisplayList(View.java:10464)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
                                                 at android.view.View.draw(View.java:11028)
                                                 at android.widget.FrameLayout.draw(FrameLayout.java:450)
                                                 at android.view.View.getDisplayList(View.java:10464)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
                                                 at android.view.View.getDisplayList(View.java:10462)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
                                                 at android.view.View.getDisplayList(View.java:10462)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
                                                 at android.view.View.getDisplayList(View.java:10462)
                                                 at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
                                                 at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
                                                 at android.view.View.getDisplayList(View.java:10462)
                                                 at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:840)
                                                 at android.view.ViewRootImpl.draw(ViewRootImpl.java:1923)
                                                 at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1647)
                                                 at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2459)
                                                 at android.os.Handler.dispatchMessage(Handler.java:99)
                                                 at android.os.Looper.loop(Looper.java:137)
                                                 at android.app.ActivityThread.main(ActivityThread.java:4514)
                                                 at java.lang.reflect.Method.invokeNative(Native Method)
                                                 at java.lang.reflect.Method.invoke(Method.java:511)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
                                                 at dalvik.system.NativeStart.main(Native Method)

Gex.. 5

我找到了解决这个问题的方法,但我不知道它为什么会正常工作.我增加了android v4 support library从版本23.0.023.1.1应用程序没有崩溃.



1> Gex..:

我找到了解决这个问题的方法,但我不知道它为什么会正常工作.我增加了android v4 support library从版本23.0.023.1.1应用程序没有崩溃.

推荐阅读
可爱的天使keven_464
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有