关于应用程序启动时,提示空指针问题
来源:互联网 发布:mysql数据库编程 编辑:程序博客网 时间:2024/04/26 07:09
最近在开发程序时,logcat偶尔会打印如下错误信息,但是程序却可以正常运行:
04-14 09:29:53.965: W/dalvikvm(1020): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-14 09:29:53.985: E/AndroidRuntime(1020): FATAL EXCEPTION: main04-14 09:29:53.985: E/AndroidRuntime(1020): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.ActivityThread.access$1300(ActivityThread.java:123)
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.os.Handler.dispatchMessage(Handler.java:99)
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.os.Looper.loop(Looper.java:137)
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.ActivityThread.main(ActivityThread.java:4424)
04-14 09:29:53.985: E/AndroidRuntime(1020): at java.lang.reflect.Method.invokeNative(Native Method)
04-14 09:29:53.985: E/AndroidRuntime(1020): at java.lang.reflect.Method.invoke(Method.java:511)
04-14 09:29:53.985: E/AndroidRuntime(1020): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-14 09:29:53.985: E/AndroidRuntime(1020): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-14 09:29:53.985: E/AndroidRuntime(1020): at dalvik.system.NativeStart.main(Native Method)
04-14 09:29:53.985: E/AndroidRuntime(1020): Caused by: java.lang.NullPointerException
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
04-14 09:29:53.985: E/AndroidRuntime(1020): at android.app.LoadedApk.makeApplication(LoadedApk.java:474)
04-14 09:29:53.985: E/AndroidRuntime(1020): ... 11 more
在网上搜了一下,也有不少人遇到这个问题,但是绝大多数都没有给出原因和解决方案,都是一些猜想~后来在国外的论坛上,看到一个回帖,觉得有些靠谱:
This is a verbose error message raised by underlying framework when dalvik re-install .apk file and trying to reuse or recycle the previous opened activity/view from the same package (if you haven't closed the previous installed app yet). It has nothing to do with your app, moreover, it is very unlikely that your app will get freezed or crashed cause by this verbose error message on end user's device.
It seems that this dalvik verbose error log only happend on Android 4.0 system, I've tested it myself on Android 3.2 and 2.3.3 running environment, where you cannot replicate to get this message shown on neither of them. A similar question has been discussed before at here and someone has filled a bug report in Android Issues Tracker.
I don't think you should concern too much about this verbose error log at the moment, if you look more logs before and after this red error in Logcat, you can see the full story and find that the previous opened activity/view (which are marked as died state) get killed and the newly re-installed one get poped ultimately.
- 关于应用程序启动时,提示空指针问题
- 关于应用程序启动时,提示空指针问题
- 关于butterknife8.0.1提示NullPointerException空指针的问题
- 关于空指针问题思考
- 关于VS2005编译的程序运行时提示“由于应用程序配置不正确,应用程序未能启动”的问题
- 关于指针的判空问题
- Android--关于Cursor空指针的问题
- 关于adapter报空指针问题
- 关于servletContext.getRealPath()空指针的问题
- 关于空指针报错的问题
- 关于win7访问ALM系统提示“应用程序主程序未能启动”问题
- butterknife8.0.1提示NullPointerException空指针的问题
- butterknife8.0.1提示NullPointerException空指针的问题
- 关于“提示db2admin尚未启动”的问题
- 关于空指针
- C++关于空指针
- 关于java中使用Session时出现空指针异常的问题
- 关于空指针调用类成员能否通过的问题
- RMQ问题
- Android图片浏览器
- EXCEL2010\2007中如何出现在数据透视表向导
- 取消反转屏的快捷键的方法
- 关于C#静态构造函数的几点说明
- 关于应用程序启动时,提示空指针问题
- try-catch-finally中return的执行情况
- 云享 企业私有网盘 免费使用
- Ztree ajax关键字检索动态树
- poj 3264 RMQ
- android4.2中的后台服务Service及配置
- c#引用类型与值类型的区别大盘点
- SmartCard API for Android、Open Mobile API
- Windows下Apache+PHP+MySQL环境配置