简体   繁体   中英

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:

我的错误

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

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.

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- 在此处输入图片说明

2- 在此处输入图片说明

3- 在此处输入图片说明

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM