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 Android Lists and Adapters (2015) Lists with RecyclerViews Introducing RecyclerView

Louis Sankey
Louis Sankey
22,595 Points

Gradle project sync failed

Hello, I tried to add the new dependency " compile 'com.android.support:recyclerview-v7:21.0.2' "but it caused the project sync to fail. I looked on google and it said try updating the compileSdkVersion to 21 buildToolsVersion to "21.0.1" which I did, but still no luck.

Here is my complete build.gradle code if it helps.

''' java

apply plugin: 'com.android.application'

android { compileSdkVersion 21 buildToolsVersion "21.0.1"

defaultConfig {
    applicationId "lmsankey.com.stormy_weather_app"
    minSdkVersion 14
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.2' compile 'com.android.support:recyclerview-v7:21.0.2' compile 'com.squareup.okhttp:okhttp:2.2.0' compile 'com.jakewharton:butterknife:6.1.0'

}

'''

thanks

2 Answers

Louis Sankey
Louis Sankey
22,595 Points

Apologies again, I answered my own question. I had to update my sdk.

Louis Sankey
Louis Sankey
22,595 Points

Apologies that my markdown didn't come through very well in the last post. It's also worth noting that gradle can't fine the appcompat dependency either.