本文介绍了该支持库不应使用其他版本,build.gradle中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的build.gradle中有一个问题. gradle中的错误是(compile 'com.android.support:appcompat-v7:24.0.0-beta1')在此行上的错误显示(此支持库不应使用与编译sdk版本23不同的版本(24)).
任何的想法?我使用的是Android Studio 2.1.2,主要问题是Android Studio中没有android支持库.图片在下面

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

推荐答案

您的compileSdkVersionbuild.gradle文件中是23,但是您尝试使用的是用于API 24的appcompat-v7:24.0.0,因此您应该对API 23使用appcompat-v7:23.x.y.如果仍然要使用appcompat-v7:24.0.0,则应将compileSdkVersion更改为24

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

您应该在compileSdkVersion 23中使用它:

You should use this for compileSdkVersion 23:

,而这是compileSdkVersion 24的情况:

and this for compileSdkVersion 24 :

修改

如果您使用的是Android Studio,则可能不必担心可用的最新版本,它会让您知道可用的最新版本.

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.

您还可以在此处

这篇关于该支持库不应使用其他版本,build.gradle中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 16:05