Question

I got a stacktrace on the google play developer console which looks like this:

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

The problem is, that I only know that there was an error in my SecondActivity class. But what can I do to find out more about what was the exact reason?

Was it helpful?

Solution

Take a look at line 42 of your SecondActivity as stated within the stacktrace:

de.myapp.foo.SecondActivity.onCreate(SecondActivity.java:42)

If you have made changes since the release and use a version control system, first checkout the corresponding release tag.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top