您的位置:首页技术文章
文章详情页

android - gradle配置recyclerview引用是报错,提示安装对应的Support Repository,请问如何解决。

【字号: 日期:2024-08-20 13:20:50浏览:94作者:猪猪

问题描述

gradle配置recyclerview引用是报错,提示安装对应的Support Repository,请问如何解决。我的引用代码如下:

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.1.0’ complie ’com.android.support:recyclerview-v7:25.0.1’ testCompile ’junit:junit:4.12’}

完整的报错的如下:

Error:Could not find method complie() for arguments [com.android.support:recyclerview-v7:25.0.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.Please install the Android Support Repository from the Android SDK Manager. <a href='https://www.haobala.com/wenda/openAndroidSdkManager'>Open Android SDK Manager</a>

根据提示我安装了所有我觉得有关系的SDK,但是报错还是存在。android - gradle配置recyclerview引用是报错,提示安装对应的Support Repository,请问如何解决。android - gradle配置recyclerview引用是报错,提示安装对应的Support Repository,请问如何解决。

问题解答

回答1:

安卓支持库在 SDK 目录下,版本统一一下即可。

compile ’com.android.support:appcompat-v7:25.1.0’compile ’com.android.support:recyclerview-v7:25.1.0’回答2:

compile ’com.android.support:appcompat-v7:+’compile ’com.android.support:recyclerview-v7:+’在不知道您版本的时候也可用+号,坏处是可能会引起编译变慢,因为会去网络上去找最新的。