Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Shaun Kelly
5,648 PointsOnce I try to run the app, a box pops up and says "Unfortunately, Hello has stopped" on the simulator.
Once i try to run the app, a black box with white text pops up and says "Unfortunately, Hello has stopped." on the simulator. "Hello" was the name of the project I created. I looked in the logcat and this is what was shown. I don't exactly know what i'm suppose to look at.
11-16 07:37:55.016 1154-1154/com.example.shaun101.hello I/Process﹕ Sending signal. PID: 1154 SIG: 9 11-16 07:41:09.596 1201-1201/com.example.shaun101.hello D/AndroidRuntime﹕ Shutting down VM 11-16 07:41:09.606 1201-1201/com.example.shaun101.hello W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xb1a9bba8) 11-16 07:41:09.636 1201-1201/com.example.shaun101.hello E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.example.shaun101.hello, PID: 1201 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.shaun101.hello/com.example.shaun101.hello.FunActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at android.app.Activity.findViewById(Activity.java:1884) at com.example.shaun101.hello.FunActivity.<init>(FunActivity.java:24) at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1208) at android.app.Instrumentation.newActivity(Instrumentation.java:1061) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)
2 Answers
Dylan Merritt
15,682 PointsHello, please post your code so that we can look over it. Thanks.
Shaun Kelly
5,648 PointsMy code is on multiple activities and classes though ?