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 trialLinus Karlsson
7,402 PointsApp crashes now
I'm moving along in this course (without any help from the community nor the teachers) but it's going slow since there are discrepancies between the video instructions and what I am myself trying to do.
Can't anybody help me? I'm paying for these classes and right now it feels pretty wasted. I cannot develop my knowledge regarding the topic at any speed at all.
I'm stuck when I try to 'Run' the app again. The message in the emulator says "Fun Facts has stopped" which I guess is a crash, but I cannot find any way to solve it.
There must be somebody in this community that can provide me some help, especially the teacher, right? I'm getting tired of all my own work arounds...
Grateful for ay assistance!
Linus Karlsson
7,402 PointsThank you so much, the both of you!
Especially you, Christoffer. I actually have started over in the class one time already, but it didn't improve my situation so much.
I'm gonna start all over again on Monday and I'll let you know how it goes. I've already looked into logcat a little bit, also thanks to stackoverflow.com, but it's pretty hard to make anything out.
(Here is my red text in logcat:
12-08 16:01:11.209 5546-5546/se.inresonance.funfacts E/AndroidRuntime: FATAL EXCEPTION: main Process: se.inresonance.funfacts, PID: 5546 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference at se.inresonance.funfacts.FunFactsActivity$1.onClick(FunFactsActivity.java:36) at android.view.View.performClick(View.java:6294) at android.view.View$PerformClick.run(View.java:24770) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
End of logcat.)
Can you make anything out of this? Or anyone else?
2 Answers
Cross Ender
9,567 PointsI'm sorry. I cannot help you. However, I have asked a variety of other students.
Christopher Stewart
7,531 PointsTake a close look at FunFactsActivity.java line 36 It looks like you are calling setText on a null TextView there.
Linus Karlsson
7,402 PointsIt's a great example! The video clearly say I should write setText(fact), but in the video it's written on line 28, instead of line 36.
One of the discrepancies that I was mentioning before. I'll start the course over today.
Thank you so much anyways!
Christopher Stewart
7,531 PointsChristopher Stewart
7,531 PointsHey, so I recently (last week) completed the Fun Facts course as well, but didn't have any problems. You mention that there are discrepancies between the video instructions and what you are trying to do. Maybe you are doing something wrong? Try following the video more closely.
Also, somewhere in the beginner track it provides a number of tips on how to debug your application. I thought it was in the Fun Facts tutorial, but just in case you haven't gotten there yet. Here are some things to try:
There were some other really good tips for debugging in the videos.
Good Luck!