今天在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
我在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' }