Strange CardView problem: ("Could not be found: com.android.support:cardview-v7:21.0.+ error")

I have Android 5.0 and the latest version of Android Support Libraries (21.0.2). I am trying to access CardView and RecyclerViews in Android. When I add:

compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'

for build.gradle dependecies applications, I get errors:

Failed to find: com.android.support:cardview-v7:21.0.+

and

Failed to find: com.android.support:recyclerview-v7:21.0.+

I am not sure why this is so. This is the only way to see how people do it (and this is the method suggested on the Google website here ). After that, I can not do CardViews or RecyclerViews in my project.

I also checked the sdk folder for Android:

C: > ... > android-sdk > extras > android > support > v7

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

, ... - , , , !

+4
3

'cardview' 'recyclerview' .

Eclipse.

" Android" SDK:

Android Support Repository in SDK Manager

Gradle Android .

+9

:

: android.support.v7.widget.CardView RecyclerView , + jar Java

→ → Android → ( sdk/extras/android/support/v7/cardview RecyclerView) → ok → Finish

cardview RecyclerView → → Android ( ) → isLibrary ( ) → → ok

→ → Android ( ) → ( ) → cardview RecyclerView → apply → ok

→ → → → jar → expand cardview RecyclerView → expand libs → android.support. v7.widget.CardView.jar RecyclerView.jar

→ android.support.v7.widget.CardView.jar RecyclerView.jar → ok

!

+1

I just had to install the correct version of lib. those. change:

compile 'com.android.support:cardview-v7:21.0' to

compile 'com.android.support:cardview-v7:21.0.2'

+1
source

All Articles