Reputation: 333
I want to add a card view so that I want to add dependencies (got from google search) when the time of adding dependencies
compile 'com.android.support:cardview-v7:21.0.+'
I am getting gradle error saying that
This support library should not use a different version (21) than the compileSdkVersion (23) less... (Ctrl+F1) There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.)
Upvotes: 0
Views: 158
Reputation: 16191
Change your CardView
dependency to:
compile 'com.android.support:cardview-v7:23.1.1'
You cannot have a different compile SDK version to versions of the support library.
Upvotes: 1
Reputation: 74
You used sdk version 23 for your project, but you use version 21 for cardview. If you compile with cardview-v7:23
there should not be a problem any more. It is also a good idea to update the support libraries, if this does not help.
Edit: As I see the picture you posted, you can see that you use 23.1.1
for the other dependencies, but 21.0.+
for the others. Change 21.0.+ to 23.1.1
Upvotes: 0