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
Jordan Peterson
5,134 PointsRibbit App Not Working
I'm working on the ribbit app. I' m on the "Modifying Fragments From The Template" video. The only thing I changed is the application name (I named it Textly). Now when I try to run the app it says "Textly has stopped". How can I fix this problem? Here is my logcat:
04-06 12:10:24.090: D/dalvikvm(25289): Late-enabling CheckJNI 04-06 12:10:24.363: I/dalvikvm(25289): Could not find method android.database.Cursor.getNotificationUri, referenced from method com.parse.ParseSQLiteCursor.getNotificationUri 04-06 12:10:24.363: W/dalvikvm(25289): VFY: unable to resolve interface method 471: Landroid/database/Cursor;.getNotificationUri ()Landroid/net/Uri; 04-06 12:10:24.363: D/dalvikvm(25289): VFY: replacing opcode 0x72 at 0x0002 04-06 12:10:24.465: D/dalvikvm(25289): GC_CONCURRENT freed 289K, 5% free 7762K/8135K, paused 2ms+5ms 04-06 12:10:24.621: I/MainActivity(25289): Jordan 04-06 12:10:24.621: D/AndroidRuntime(25289): Shutting down VM 04-06 12:10:24.621: W/dalvikvm(25289): threadid=1: thread exiting with uncaught exception (group=0x40a9e1f8) 04-06 12:10:24.629: E/AndroidRuntime(25289): FATAL EXCEPTION: main 04-06 12:10:24.629: E/AndroidRuntime(25289): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jordanpeterson.textly/com.jordanpeterson.textly.MainActivity}: java.lang.NullPointerException 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2030) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2055) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.app.ActivityThread.access$600(ActivityThread.java:127) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1176) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.os.Handler.dispatchMessage(Handler.java:99) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.os.Looper.loop(Looper.java:137) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.app.ActivityThread.main(ActivityThread.java:4532) 04-06 12:10:24.629: E/AndroidRuntime(25289): at java.lang.reflect.Method.invokeNative(Native Method) 04-06 12:10:24.629: E/AndroidRuntime(25289): at java.lang.reflect.Method.invoke(Method.java:511) 04-06 12:10:24.629: E/AndroidRuntime(25289): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 04-06 12:10:24.629: E/AndroidRuntime(25289): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 04-06 12:10:24.629: E/AndroidRuntime(25289): at dalvik.system.NativeStart.main(Native Method) 04-06 12:10:24.629: E/AndroidRuntime(25289): Caused by: java.lang.NullPointerException 04-06 12:10:24.629: E/AndroidRuntime(25289): at com.jordanpeterson.textly.MainActivity.onCreate(MainActivity.java:54) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.app.Activity.performCreate(Activity.java:4635) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 04-06 12:10:24.629: E/AndroidRuntime(25289): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1994) 04-06 12:10:24.629: E/AndroidRuntime(25289): ... 11 more 04-06 12:10:24.754: D/dalvikvm(25289): GC_CONCURRENT freed 384K, 7% free 7803K/8327K, paused 1ms+2ms 04-06 12:10:25.199: D/dalvikvm(25289): GC_CONCURRENT freed 375K, 6% free 7892K/8391K, paused 1ms+3ms
9 Answers
Steve Hunter
57,712 PointsHi Jordan,
Out of all of that, the key bit is this:
FATAL EXCEPTION: main 04-06 12:10:24.629: E/AndroidRuntime(25289): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jordanpeterson.textly/com.jordanpeterson.textly.MainActivity}: java.lang.NullPointerException
Something you're using is pointing at nothing causing the Activity to fail. Can you post the code for MainActivity or, even better, upload the whole project to Github so we can run the whole thing.
Steve.
Steve Hunter
57,712 PointsWhen does the error occur? Just when you run it, or when you do something within the app?
Steve.
Jordan Peterson
5,134 PointsHi Steve, The app crashes when I try to run it. I've tried it on my emulator and on my Android device. I am getting a lot of warnings in MainActivity it says "The type ActionBar.Tab is deprecated" and "The type ActionBar.tabListener is deprecated". I'm not sure if that has anything to do with it not running? Thanks again for helping me!
Jordan.
Steve Hunter
57,712 PointsCould you zip your project and email it to me at steve [dot] r [dot] hunter [at] gmail [dot] com
I'll load it into my machine and see what I can find out.
I've been staring at code all day so I've gone blind to it ... I need to run it and work my way through it.
Steve.
Jordan Peterson
5,134 PointsI emailed you the zip file.
Steve Hunter
57,712 PointsReceived, cool. It's 23:30 here right now so that may have to wait until morning but I'll see if the emailed file works before I go for some sleep.
Steve.
Steve Hunter
57,712 PointsYour code is in my Github repo here - that's exactly as you sent it within the 'initial commit' part.
I'll work on it from there and add further -m commits to try to solve your issue!
Steve.
Steve Hunter
57,712 PointsUpdated that and got somewhere nearer the problem ... repo is probably the same as the first one.
Get hold of a Github account. It is one of the most useful things you will ever do. And it is free! \o/
Steve.
Steve Hunter
57,712 PointsFixed!
I've emailed it back to you or you can pull it down from the Github links above.
Cheers!
Steve.
Jordan Peterson
5,134 PointsHi Steve, I imported the projects into eclipse. I'm now seeing a lot of errors. It might just be eclipse messing up. I've tried cleaning and building the project. A lot of the errors are saying stuff like "ActionBar cannot be resolved to a type" and "The method isEmpty() is undefined for the type String"...etc. All the problems are happening in my activities.
Thank you, Jordan.
Steve Hunter
57,712 PointsDid this work in the end or are you still having problems with it.
If you are, there must be something different between our respective setups. I'm not sure what that might be, though. Happy to look through that again to see what needs changing.
Steve.
Jordan Peterson
5,134 PointsHi Steve, I am still getting a bunch of errors for some reason. I've tried the project in eclipse and in Android Studio and I'm still getting errors.
Steve Hunter
57,712 PointsCan you take me a screen shot of Android Studio with the errors showing? I'll see what I can make of them.
Steve.
Jordan Peterson
5,134 PointsI emailed you the screenshots of the errors I keep getting. Thanks again for helping me!
Steve Hunter
57,712 PointsHas Android Studio fully started up? It can take a while to settle down.
I'll check my code again ... it worked earlier; promise!
Steve Hunter
57,712 PointsYour app working - http://goo.gl/mGzzOq
Steve Hunter
57,712 PointsNot sure if this will work, but this is a link to a video of Android Studio with your app loaded, showing no errors.
https://drive.google.com/file/d/0ByAW6RAWFnHjMUh6RV91aktTUHM/view?usp=sharing
Jordan Peterson
5,134 PointsHi Steve, My app is fixed now! Thank you so much for helping me!
Jordan.
Steve Hunter
57,712 PointsAwesome!! I hoped I helped at least a little ... that got complicated!
Shout if you run into any other problems.
Steve.
Jordan Peterson
5,134 PointsJordan Peterson
5,134 PointsHi Steve,
Thanks for writing me back. I haven't gotten the chance to learn how to use Github yet. Here is the code from my