简体   繁体   English

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

[英]App Crashes Only When in Emulator

My app crashes when I try to launch a new activity. 尝试启动新活动时,我的应用程序崩溃。 The stack trace does not show anything from my code. 堆栈跟踪未显示我的代码中的任何内容。 I have tested it in both the 1.6 emulator and the 2.1 emulator and it crashes in both situations however it runs on a 2.2 device. 我已经在1.6仿真器和2.1仿真器中对其进行了测试,但是在两种情况下均会崩溃,但是它可以在2.2设备上运行。 Does anyone know what could make the emulator crash like this? 有谁知道会使模拟器崩溃的原因是什么?

Stacktrace 堆栈跟踪

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'

Reinstalled the Android SDK and everything seems to be fine. 重新安装了Android SDK,一切似乎都很好。 Very weird! 很奇怪!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM