如何修复错误:找不到recyclerview-v7.jar(com.android.support:recyclerview-v7:28.0.0)

问题描述 投票:0回答:1

我是Android新手。我想在我的项目中使用recyclelerview,当我将com.android.support:recyclerview-v7:28.0.0实现为依赖项并构建项目时,我收到此错误:

Could not find recyclerview-v7.jar (com.android.support:recyclerview-v7:28.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/support/recyclerview-v7/28.0.0/recyclerview-v7-28.0.0.jar


Please install the Android Support Repository from the Android SDK Manager.
Open Android SDK Manager

我的build.gradle(模块:app):

apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.example.myapplication"
    minSdkVersion 15
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
}

和build.gradle(Myapplication):

buildscript {
repositories {
    google()
    jcenter()


}
dependencies {
    classpath 'com.android.tools.build:gradle:3.3.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    google()
    jcenter()

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

顺便说一句,在sdk管理中,安装了android支持存储库,我的Android sdk工具是26.1.1

任何人都可以帮我解决这个错误?

android android-gradle android-studio-3.0
1个回答
0
投票

您必须从SDK Tools安装Support Repository,如图所示。请在Support Repository中选中复选框并安装enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.