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?

Newly created project in Android studio 1.2.2 does no longer compile with okhttp.

After creating a new project, all I did is to modify build.gradle

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.squareup.okhttp:okhttp:2.4.0' }

This is my Gradle console:

Executing tasks: [clean, :app:compileDebugSources, :app:compileDebugAndroidTestSources]

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':app'.

    Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not resolve com.squareup.okhttp:okhttp:2.4.0. Required by: DemoApp122:app:unspecified Could not GET 'https://jcenter.bintray.com/com/squareup/okhttp/okhttp/2.4.0/okhttp-2.4.0.pom'. > peer not authenticated

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 10.611 secs Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':app'.

    Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not resolve com.squareup.okhttp:okhttp:2.4.0. Required by: DemoApp122:app:unspecified Could not GET 'https://jcenter.bintray.com/com/squareup/okhttp/okhttp/2.4.0/okhttp-2.4.0.pom'. > peer not authenticated

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.763 secs