在app/build.gradle中声明依赖库失败的问题

今天在dependencies中添加最后三行的时候,系统提示报错:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.2.0'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:25.2.0'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:cardview-v7:24.2.1'
}

Error:(31, 13) Failed to resolve: com.android.suport:recyclerview-v7:24.2.1 

Error:(31, 13) Failed to resolve: com.android.suport:cardview-v7:24.2.1 

我在D:\AS\AndroidSDK\build-tools中发现我并没有24.2.1的包,于是我改成了现有的25.0.2包。


结果仅提示Error:(31, 13) Failed to resolve: com.android.suport:cardview-v7:24.2.1 


我再次把所有的compile都改成了25.0.2包(因为我并没有在build-tools中发现25.2.0),系统提示全部失败。并给出提示可用25.2.0的包。

最后我将所有的compile都改成25.2.0包,添加依赖库成功。

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.2.0'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:25.2.0'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.support:recyclerview-v7:25.2.0'
    compile 'com.android.support:cardview-v7:25.2.0'
}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值