IntelliJ IDEA的 - 显示异常痕迹 [英] IntelliJ IDEA - Show Exception Traces

查看:1122
本文介绍了IntelliJ IDEA的 - 显示异常痕迹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜了一下这里帮助的,但没有实质性的

I found a bit of help here, but nothing substantial.

我已经成功地感动我从Eclipse中的Andr​​oid项目的IntelliJ IDEA,并正尝试习惯的用户界面。我已经将它设置为构建和运行,但是当我抛出一个异常,我无法弄清楚如何看待像Eclipse presents它的堆栈跟踪。

I've successfully moved my Android project from Eclipse to IntelliJ IDEA, and am trying to get used to the UI. I've set it up to build and run, but when I throw an exception, I can't figure out how to view the stack trace like Eclipse presents it.

例如,在Eclipse中运行以下命令:

For example, running this in Eclipse:

((TextView)findViewById(R.id.abs__action_bar)).setText("Temp");

得到以下,在Eclipse的LogCat中的查看:

Yields the following, in Eclipse's "LogCat" View:

E/AndroidRuntime(341): FATAL EXCEPTION: main
E/AndroidRuntime(341): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appname/com.appname.activity.HomeActivity}: java.lang.ClassCastException: com.actionbarsherlock.internal.widget.ActionBarView
E/AndroidRuntime(341):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
E/AndroidRuntime(341):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
E/AndroidRuntime(341):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime(341):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime(341):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(341):  at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(341):  at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime(341):  at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(341):  at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(341):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(341):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(341):  at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(341): Caused by: java.lang.ClassCastException: com.actionbarsherlock.internal.widget.ActionBarView
E/AndroidRuntime(341):  at com.appname.activity.HomeActivity.init(HomeActivity.java:150)
E/AndroidRuntime(341):  at com.appname.activity.HomeActivity.access$0(HomeActivity.java:127)
E/AndroidRuntime(341):  at com.appname.activity.HomeActivity$1.execute(HomeActivity.java:111)
E/AndroidRuntime(341):  at com.appname.helper.Security.checkCredentialsAndLogin(Security.java:139)
E/AndroidRuntime(341):  at com.appname.activity.HomeActivity.onCreate(HomeActivity.java:118)
E/AndroidRuntime(341):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(341):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
E/AndroidRuntime(341):  ... 11 more

而在我的IntelliJ刚刚得到的东西看起来像这样,当我调试项目名,让所有异常中断之后:

Whereas in IntelliJ I just get something that looks like this, when I "Debug ProjectName", after enabling "Break on all Exceptions":

推荐答案

IntelliJ IDEA的有一个单独的 Android的logcat的标签,异常记录在那里。如果你的目标4.1平台,确保使用IDEA 11.1.3这为近期的logcat的变化兼容性。

IntelliJ IDEA has a separate Android Logcat tab, exceptions are logged there. If you are targeting 4.1 Platform, make sure to use IDEA 11.1.3 which provides compatibility for the recent changes in Logcat.

这篇关于IntelliJ IDEA的 - 显示异常痕迹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆