我在google play开发者控制台上得到了一个堆栈跟踪,如下所示:
java.lang.RuntimeException: Unable to start activity ComponentInfo{de.myapp.foo/de.myapp.foo.SecondActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at de.myapp.foo.SecondActivity.onCreate(SecondActivity.java:42)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
... 11 more
问题是,我只知道我的SecondActivity
课程中有错误。但我该怎么做才能找到更多关于究竟原因的原因?
答案 0 :(得分:4)
按照堆栈跟踪中的说明,查看SecondActivity
的第42行:
de.myapp.foo.SecondActivity.onCreate(SecondActivity.java:42)
如果您自发布以来进行了更改并使用版本控制系统,请先检查相应的发布标记。