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

Android

Not able to run the app when requesting data from the web?

02-10 16:45:10.254: E/AndroidRuntime(1308): FATAL EXCEPTION: main 02-10 16:45:10.254: E/AndroidRuntime(1308): Process: com.jeryalthaf.rainy, PID: 1308 02-10 16:45:10.254: E/AndroidRuntime(1308): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jeryalthaf.rainy/com.jeryalthaf.rainy.MainActivity}: java.lang.NullPointerException 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.app.ActivityThread.access$800(ActivityThread.java:135) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.os.Handler.dispatchMessage(Handler.java:102) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.os.Looper.loop(Looper.java:136) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.app.ActivityThread.main(ActivityThread.java:5001) 02-10 16:45:10.254: E/AndroidRuntime(1308): at java.lang.reflect.Method.invokeNative(Native Method) 02-10 16:45:10.254: E/AndroidRuntime(1308): at java.lang.reflect.Method.invoke(Method.java:515) 02-10 16:45:10.254: E/AndroidRuntime(1308): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 02-10 16:45:10.254: E/AndroidRuntime(1308): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 02-10 16:45:10.254: E/AndroidRuntime(1308): at dalvik.system.NativeStart.main(Native Method) 02-10 16:45:10.254: E/AndroidRuntime(1308): Caused by: java.lang.NullPointerException 02-10 16:45:10.254: E/AndroidRuntime(1308): at com.jeryalthaf.rainy.MainActivity.onCreate(MainActivity.java:57) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.app.Activity.performCreate(Activity.java:5231) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 02-10 16:45:10.254: E/AndroidRuntime(1308): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 02-10 16:45:10.254: E/AndroidRuntime(1308): ... 11 more

Logcat details.

Is it possible to see your code please. Not entirely sure, have you by any chance renamed your Launcher activity (the one defined in your android manifest) to something other than MainActivity.

You seem to be getting a NullPointerException when trying to start this activity which makes me wonder if you have simply renamed it by mistake.

1 Answer