Strange CardView issue: ("Failed to find: com.android.support:cardview-v7:21.0.+" Error)

android, android-cardview, android-support-library

Solution

and both the 'cardview' and 'recyclerview' directories are there with all the files in them.

Those are for Eclipse.

You need to install the "Android Support Repository" in your SDK Manager:

That should enable Gradle for Android to find those artifacts.

Problem

I have Android 5.0 and the most current version of the Android Support Libraries (21.0.2). I am trying to access the CardView and the RecyclerViews in Android. When I add: ``` compile 'com.android.support:cardview-v7:21.0.+' compile 'com.android.support:recyclerview-v7:21.0.+' ``` to the app's build.gradle dependecies, I get the errors: ``` Failed to find: com.android.support:cardview-v7:21.0.+ ``` and ``` Failed to find: com.android.support:recyclerview-v7:21.0.+ ``` I'm not sure why this is. This is the only way I have seen people do it (and it's the way suggested on Google's website here). After this, I cannot make CardViews or RecyclerViews in my project. I have also checked my android sdk folder: ``` C: > ... > android-sdk > extras > android > support > v7 ``` and both the 'cardview' and 'recyclerview' directories are there with all the files in them. I'm not sure why this is so... If you have any questions please ask and any suggestions or answers would be greatly appreciated!

Original source