如何找出导致 Android 应用程序崩溃的错误?

发布于 2024-12-15 18:29:20 字数 2482 浏览 0 评论 0原文

我正在创建一个向 XML 站点发出 http 请求的应用程序。然后我使用 DOM 从 XML 获取信息。问题是,当我尝试在 Android 模拟器中运行该应用程序时,该应用程序崩溃了,但当我将它作为 java 应用程序运行时,它运行良好。我如何找出导致我的 Android 应用程序崩溃的错误?我已启用使用互联网的权限。

我认为这是来自 LogCat 的错误:

11-15 11:57:37.618: WARN/dalvikvm(280): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
11-15 11:57:37.639: ERROR/AndroidRuntime(280): FATAL EXCEPTION: main
11-15 11:57:37.639: ERROR/AndroidRuntime(280): android.app.SuperNotCalledException: Activity {xml.android.test/xml.android.test.AndroidXMLActivity} did not call through to super.onCreate()
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2629)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.os.Looper.loop(Looper.java:123)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread.main(ActivityThread.java:4627)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at java.lang.reflect.Method.invokeNative(Native Method)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at java.lang.reflect.Method.invoke(Method.java:521)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at dalvik.system.NativeStart.main(Native Method)
11-15 11:57:37.702: WARN/ActivityManager(59):   Force finishing activity xml.android.test/.AndroidXMLActivity
11-15 11:57:38.220: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{44ed8770 xml.android.test/.AndroidXMLActivity}
11-15 11:57:38.228: INFO/ActivityManager(59): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 27460 ms (total 27460 ms)
11-15 11:57:48.303: WARN/ActivityManager(59): Activity destroy timeout for HistoryRecord{44ed8770 xml.android.test/.AndroidXMLActivity}

I'm creating an application that's making a http request to a XML site. I'm then using DOM to get the information from XML. Problem is that the app is crashing when i try to run it in android emulator but it works perfectly when i run it as an java app. How can i find out what error is causing my android application to crash? I've enabled the permission to use internet.

I think this is the error from LogCat im getting:

11-15 11:57:37.618: WARN/dalvikvm(280): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
11-15 11:57:37.639: ERROR/AndroidRuntime(280): FATAL EXCEPTION: main
11-15 11:57:37.639: ERROR/AndroidRuntime(280): android.app.SuperNotCalledException: Activity {xml.android.test/xml.android.test.AndroidXMLActivity} did not call through to super.onCreate()
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2629)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.os.Looper.loop(Looper.java:123)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at android.app.ActivityThread.main(ActivityThread.java:4627)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at java.lang.reflect.Method.invokeNative(Native Method)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at java.lang.reflect.Method.invoke(Method.java:521)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-15 11:57:37.639: ERROR/AndroidRuntime(280):     at dalvik.system.NativeStart.main(Native Method)
11-15 11:57:37.702: WARN/ActivityManager(59):   Force finishing activity xml.android.test/.AndroidXMLActivity
11-15 11:57:38.220: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{44ed8770 xml.android.test/.AndroidXMLActivity}
11-15 11:57:38.228: INFO/ActivityManager(59): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 27460 ms (total 27460 ms)
11-15 11:57:48.303: WARN/ActivityManager(59): Activity destroy timeout for HistoryRecord{44ed8770 xml.android.test/.AndroidXMLActivity}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

淡淡離愁欲言轉身 2024-12-22 18:29:20

使用 logcat 检查模拟器日志中的崩溃消息。如果该消息解释了您的问题,请修复它。如果没有将消息添加到您的帖子中,也许我们能够帮助您。

Use logcat to check the emulator log for the crash message. If the message explains your problem fix it. If not add the message to your post and maybe we will be able to help you.

无人问我粥可暖 2024-12-22 18:29:20

您可以使用 LogCat 来获取崩溃原因。它在Eclipse中可用,最左角有一个按钮,单击该按钮可以看到Logcat的选项。当您启动应用程序时,它会显示所有日志。当应用程序崩溃时,它将显示到崩溃的行级别。

You can use LogCat for getting the reason of crash. it is available in the Eclipse, very left corner there is button and by clicking that you can see the option of the Logcat. when you launch the application it will show you all the logs. and when application crashes it will show upto the line level of crash.

真心难拥有 2024-12-22 18:29:20

这是您的问题:

android.app.SuperNotCalledException: Activity {xml.android.test/xml.android.test.AndroidXMLActivity} did not call through to super.onCreate()

这意味着您的活动 onCreate 方法应该调用 super.onCreate() (作为其第一行)。

This is your problem:

android.app.SuperNotCalledException: Activity {xml.android.test/xml.android.test.AndroidXMLActivity} did not call through to super.onCreate()

It means your activity onCreate method should call super.onCreate() (as its first line).

温柔少女心 2024-12-22 18:29:20

您可以使用运行应用程序时发现的 logcat,并且可以根据要显示的消息类型放置 Log.e 或 iv。这样您就可以检测到确切的错误以及应用程序崩溃的位置。

You can use logcat which you will find running your applications, and you can put Log.e or i v depending on what type of message you want to display. This way you can detect the exact error and where the application crashes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文