记一次应用启动bug
来源:互联网 发布:清新博客程序源码 编辑:程序博客网 时间:2024/04/28 18:15
日志原文:
08-19 15:10:17.825 27280-27280/? I/art: Late-enabling -Xcheck:jni08-19 15:10:17.879 27280-27280/com.swipefresh W/System: ClassLoader referenced unknown path: /data/app/com.swipefresh-1/lib/arm08-19 15:10:18.040 27280-27280/com.swipefresh W/ResourceType: No known package when getting value for resource number 0xff88888808-19 15:10:18.043 27280-27280/com.swipefresh D/AndroidRuntime: Shutting down VM08-19 15:10:18.044 27280-27280/com.swipefresh E/AndroidRuntime: FATAL EXCEPTION: main Process: com.swipefresh, PID: 27280 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.swipefresh/com.swipefresh.MainActivity}: android.content.res.Resources$NotFoundException: Resource ID #0xff888888 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2423) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483) at android.app.ActivityThread.access$900(ActivityThread.java:153) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5438) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) Caused by: android.content.res.Resources$NotFoundException: Resource ID #0xff888888 at android.content.res.Resources.getValue(Resources.java:1369) at android.content.res.MiuiResources.getValue(MiuiResources.java:145) at android.content.res.Resources.getColor(Resources.java:981) at android.content.res.Resources.getColor(Resources.java:954) at android.support.v4.widget.SwipeRefreshLayout.setProgressBackgroundColorSchemeResource(SwipeRefreshLayout.java:482) at android.support.v4.widget.SwipeRefreshLayout.setProgressBackgroundColor(SwipeRefreshLayout.java:473) at com.swipefresh.MainActivity.onCreate(MainActivity.java:17) at android.app.Activity.performCreate(Activity.java:6303) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483) at android.app.ActivityThread.access$900(ActivityThread.java:153) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5438) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) 08-19 15:10:20.623 27280-27280/? I/Process: Sending signal. PID: 27280 SIG: 9
从中我们不仅能看出问题出在哪儿,而且还可以借此了解下应用程序初始化执行流程,因为这个问题是在应用刚启动的时候出现的,重点执行流程是:
(为便于阅读,我已经将日志顺序倒过来,和执行顺序保持一致)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)java.lang.reflect.Method.invoke(Native Method) android.app.ActivityThread.main(ActivityThread.java:5438) android.os.Looper.loop(Looper.java:148) android.os.Handler.dispatchMessage(Handler.java:102)android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) android.app.ActivityThread.access$900(ActivityThread.java:153)android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483) android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376)android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)android.app.Activity.performCreate(Activity.java:6303)com.swipefresh.MainActivity.onCreate(MainActivity.java:17)
可以看出程序是从ZygoteInit.main 629行开始,最终到MainActivity.onCreate。这样比首先在源码里直接分析流程快多了。
那么有其他方法可以帮助我们分析应用启动流程吗,答案是有的, Thread.dumpStack()。
0 0
- 记一次应用启动bug
- 记一次bug追踪
- 解决tomcat无法启动的一次bug
- 记一次bug解决过程
- 记一次CEdit的bug
- 记一次神秘的BUG
- 记一次附件上传bug
- 记一次愚蠢的BUG
- 记一次不愉快的bug修复
- 记一次CSS弹出动画的Bug
- 记一次有趣的bug查找
- 记一次CSS引发的小Bug
- 趣图:记一次百思不得其解的 Bug/异常
- 记一次百思不得其解的 Bug/异常
- 记一次关于list的bug
- 记一次 BUG 的排查过程
- 记一次电脑启动失败
- 不同的启动方式,应用启动多次的Bug解决
- nodejs 盖楼评论
- socket通信server+client的C++版
- Think in java中的final
- Codeforces Problem 710A King Moves(implementation)
- 浅谈Code Review
- 记一次应用启动bug
- 9. Palindrome Number
- 【cdoj 1071】秋实大哥下棋 扫描线+线段树+脑洞
- 回溯——八皇后问题
- 图片上传通过Bitmap转换成Base64编码然后当做请求参数上传
- 线性表-顺序存储结构
- Android中保存文件到指定路径下
- 你交给某人一个程序,你将折磨他一整天,如果你教某人如何编写程序,你将折磨一辈子。
- 数据结构实验之数组三:快速转置