关于This support library should not use a different version than the compilesdkversion

问题描述:this support library should not use a different version than the compilesdkversion
在build.gradle中

 dependencies {
        // lib编译jar包
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:.21.0+'
        compile 'com.android.support:recyclerview-v7:.21.0+'
        compile('io.socket:socket.io-client:0.7.0') {
            exclude group: 'org.json', module: 'json'
        }
    }

解决之道:
①转自:http://stackoverflow.com/questions/32062460/android-appcompat-v723
Original answer:

I too tried to change the support library to “23”. When I changed the targetSdkVersion to 23, Android Studio reported the following error:

This support library should not use a lower version (22) than the targetSdkVersion (23)
I simply changed:

compile ‘com.android.support:appcompat-v7:23.0.0’
to

compile ‘com.android.support:appcompat-v7:+’
Although this fixed my issue, you should not use dynamic versions. After a few hours the new support repository was available and it is currently 23.0.1.
最好不要用动态版本。
Pro tip:

You can use double quotes(双引号) and create a ${supportLibVersion} variable for simplicity. Example:

ext {
supportLibVersion = ‘23.1.1’
}

compile “com.android.support:appcompat-v7: supportLibVersioncompilecom.android.support:design: {supportLibVersion}”
compile “com.android.support:palette-v7: supportLibVersioncompilecom.android.support:customtabs: {supportLibVersion}”
compile “com.android.support:gridlayout-v7:${supportLibVersion}”

来源
source: https://twitter.com/manidesto/status/669195097947377664

shareimprove this answer
edited Nov 26 ‘15 at 9:40
answered Aug 18 ‘15 at 3:18

Jared Rummler
12.7k54868

②转自http://stackoverflow.com/questions/29284236/failed-to-resolve-com-android-supportappcompat-v722-and-com-android-supportre

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值