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 How Do We Get Data from the Web?

Why okhttp does no longer work or gives an error (Android Studio 1.2.2)?

Dear TeamTreeHouse,

I have completed the Android track, Building the Weather App, it was all fine, when I recompile with Android Studio 1.2.2 the line below gives me an error that I have no clue how to solve:

For the simplistic case, I create a brand new project, and I add the line below in build.gradle:

compile 'com.squareup.okhttp:okhttp:2.4.0'

After I compile I get:

Error:(29, 13) Failed to resolve: com.squareup.okhttp:okhttp:2.4.0 <a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

What I need to do is to read Json data out of a restful webservice, pretty much in the same way as the weather app does.

Grateful for your help,

Seth Kroger
Seth Kroger
56,413 Points

Can you post both build.gradle files, app and project?

Ok, I am ready to post my files, I do not see the attachment button.

Ok, I've added the whole zipped project via drag and drop, can you see it?