BigBugCreator
BigBugCreator

Reputation: 1059

I can't import card library in my Android Studio

Today I install Android Studio in my new Pc, I tried to start a new project but I couldn´t because I have this error when I try to compile some new library of Material Design as CardView or RecyclerView, I was reading about this problem and I tried to do everything, I installed all SDK, I change the library versions a lot times, but I cant resolve this =(.

This is the picture of my error:

My Error

Please, any help will be greatfully. I can´t program if I dont resolve this.

Upvotes: 0

Views: 178

Answers (3)

humazed
humazed

Reputation: 76952

just use
compile 'com.android.support:recyclerview-v7:22.2.1'

as the popup says the library you try to import doesn't work with android version 22

and to make sure you don't import outdated libraries like this import them that way.

1-enter image description here

2-enter image description here

3-enter image description here

Upvotes: 1

arodriguezdonaire
arodriguezdonaire

Reputation: 5563

Import with compile 'com.android.support:recyclerview-v7:22.2.1' , this should work with API 22.

Click on Sync now in the warning on top of the code window.

If it doesn't work, try Build -> Rebuild Project. Seems that your gradle file doesn't refresh automatically

If it doesn't work check in the SDK Manager that you have install all the SDK pachages needed for those libraries and rebuild again.

Upvotes: 2

Nivedh
Nivedh

Reputation: 961

Add card view lib from Open module settings-> app -> dependencies-> + -> Library dependency. It will be perfect . this happens you have updated version 22 installed in your sdk and not the previous version 21 .
or use compile 'com.android.support:cardview-v7:22.2.1'

Upvotes: 1

Related Questions