Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

This support library should not use a different version, error in build.gradle

There is one problem in my build.gradle. The error in the gradle is that ( compile 'com.android.support:appcompat-v7:24.0.0-beta1') on this line the error display that (This support library should not use a different version(24 ) then the compile sdk version 23)
Any idea? And I used Android Studio 2.1.2 and the main problem is that in Android studio there is no android support library. pic is below

enter image description here

like image 441
Mahmood khan Avatar asked Jun 28 '16 09:06

Mahmood khan


1 Answers

Your compileSdkVersion is 23 in the build.gradle file but you're trying to use appcompat-v7:24.0.0 which is for API 24, so you should use appcompat-v7:23.x.y for API 23. If you still want to use appcompat-v7:24.0.0 then you should change the compileSdkVersion to 24

You should use this for compileSdkVersion 23:

compile 'com.android.support:appcompat-v7:23.4.0'

and this for compileSdkVersion 24 :

compile 'com.android.support:appcompat-v7:24.0.0'

Edit

If you work on Android Studio, then you probably don't need to worry about the latest version available, it'll let you know about the latest available version.

You can also check the latest versions available for every sdk version here

like image 148
Ashish Ranjan Avatar answered Sep 29 '22 08:09

Ashish Ranjan