您的位置:首页 > Web前端

This support library should not use a different version(x)than the compileSdkVersion(y)

2017-02-23 17:40 501 查看
转载请注明来源李岳锋的博客

与这个错误是同个原理的,请举一反三:This support library should not use a different version(x)than the targetSdkVersion(y)。一个是编译版本不一致,一个是目标版本不一致。

1、com.android.support:recyclerview-v7:x.x.x

2、com.android.support:recyclerview-v7:x.x.x

3、com.android.support:support-v4:x.x.x

4、com.android.support:support-v7:x.x.x

….

在导入这些包之后,报了这个错This support library should not use a different version(x)than the compileSdkVersion(y)。

原因是你的compileSdkVersion版本(即编译版本)与你所导入的support包的版本不同。如果你的编译版本的API是23。那你导入的support包对应的API也应该是:23.x.x。

以要导入V7包,然后编译版本的API为24为例:

则导入的应该是 compile ‘com.android.support:support-v7:24.x.x’

至于24后面的x.x,是指24版下的子版本,是多少就无所谓了。我现在要导入的是:

compile ‘com.android.support:recyclerview-v7:24.1.1’是这个。而且编译版本的API是24.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android
相关文章推荐