Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Weather App Hooking Up the Model to the View Plugging in the Data

I am getting a NullPointerExcetion ...........

I am getting a null pointer exception when i run the app ....

Here is my error lines......... 2019-03-22 12:21:49.596 15020-15078/? E/ActivityThread: Failed to find provider info for com.facebook.appmanager.oxygen.nekodirect.progress 2019-03-22 12:21:49.643 14868-14951/com.yogigorle.stormy E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.yogigorle.stormy, PID: 14868 java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.yogigorle.stormy.CurrentWeather.getLocationLabel()' on a null object reference at com.yogigorle.stormy.MainActivity$1.onResponse(MainActivity.java:71) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:216) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:760)

Alexander Zola
Alexander Zola
9,027 Points

my bet its error getting data from http / okhttp3

1 Answer

Tonnie Fanadez
.a{fill-rule:evenodd;}techdegree seal-36
Tonnie Fanadez
UX Design Techdegree Graduate 22,795 Points

Hi bhogi gandu

Have seen the Log Cat error but need to see your code around line 71 on the MainActivity. It seems there is something that has been initialized possibly the CurrentWeather class or some TextView.

Let me know please.