This support library should not use a different ve

2019-01-18 11:11发布

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

2条回答
趁早两清
2楼-- · 2019-01-18 11:47

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

查看更多
够拽才男人
3楼-- · 2019-01-18 12:06

Yep, they must not be different. Change it to compile 'com.android.support:appcompat-v7:23.4.0'

查看更多
登录 后发表回答