应用程序仅在模拟器中崩溃

时间:2012-01-13 21:23:14

标签: java android android-emulator

当我尝试发布新活动时,我的应用崩溃了。堆栈跟踪不会显示我的代码中的任何内容。我已经在1.6仿真器和2.1仿真器中测试了它,它在两种情况下崩溃,但它在2.2设备上运行。有谁知道什么会让模拟器像这样崩溃?

堆栈跟踪

01-13 16:18:33.232: E/AndroidRuntime(284): Uncaught handler: thread main exiting due to uncaught exception
01-13 16:18:33.232: E/AndroidRuntime(284): java.lang.NullPointerException
01-13 16:18:33.232: E/AndroidRuntime(284):  at android.widget.TabHost.dispatchWindowFocusChanged(TabHost.java:292)
01-13 16:18:33.232: E/AndroidRuntime(284):  at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:659)
01-13 16:18:33.232: E/AndroidRuntime(284):  at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:659)
01-13 16:18:33.232: E/AndroidRuntime(284):  at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:659)
01-13 16:18:33.232: E/AndroidRuntime(284):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1782)
01-13 16:18:33.232: E/AndroidRuntime(284):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-13 16:18:33.232: E/AndroidRuntime(284):  at android.os.Looper.loop(Looper.java:123)
01-13 16:18:33.232: E/AndroidRuntime(284):  at android.app.ActivityThread.main(ActivityThread.java:4203)
01-13 16:18:33.232: E/AndroidRuntime(284):  at java.lang.reflect.Method.invokeNative(Native Method)
01-13 16:18:33.232: E/AndroidRuntime(284):  at java.lang.reflect.Method.invoke(Method.java:521)
01-13 16:18:33.232: E/AndroidRuntime(284):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
01-13 16:18:33.232: E/AndroidRuntime(284):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
01-13 16:18:33.232: E/AndroidRuntime(284):  at dalvik.system.NativeStart.main(Native Method)
01-13 16:18:33.242: I/dalvikvm(284): threadid=7: reacting to signal 3
01-13 16:18:33.422: I/dalvikvm(284): Wrote stack trace to '/data/anr/traces.txt'

1 个答案:

答案 0 :(得分:0)

重新安装Android SDK,一切似乎都没问题。非常奇怪!