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 Build a Weather App (2015) Networking Making an HTTP GET Request with OkHttp

Navneeth Ramprasad
Navneeth Ramprasad
740 Points

Creating an instance of the OkHttpClient class is throwing me an error

Please answer

Ken Alger
Ken Alger
Treehouse Teacher

Navneeth;

Welcome to Treehouse!

I know it is frustrating to be getting errors in you code, but if you would post the code you are trying and the errors you are getting with that code it will greatly help forum users to assist in debugging your code.

Ken

3 Answers

Please provide the class and error details

Jesse Gravenor
Jesse Gravenor
27,272 Points

I had a similar problem at this stage. I tried everything several times and it was not my code. I think it is related to the version of android studio that I am running and the version of the OKHttp dependency that I was loading in the Gradle file. When I changed the dependancy from: compile 'com.squareup.okhttp:okhttp:2.2.0' to 2.1.0, as was shown in the video everything worked from there. I hope this helps your!

Make sure you have removed "test" from compile 'com.squareup.okhttp:okhttp:2.1.0'