我不能在我的项目中使用RecyclerView和CardView

时间:2017-11-11 18:52:11

标签: android android-recyclerview android-gradle android-appcompat

我想在我的项目中使用RecyclerView,但我不能。 Android无法解决依赖关系。并给出以下错误:

Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:recyclerview-v7:26.1.0.
I tried many methods but failed every time: 
Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.android.support:recyclerview-v7:26.1.0.
  Required by:
      project :app
   > Could not resolve com.android.support:recyclerview-v7:26.1.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/recyclerview-v7/26.1.0/recyclerview-v7-26.1.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/recyclerview-v7/26.1.0/recyclerview-v7-26.1.0.pom'.
            > Remote host closed connection during handshake

依赖项列表:

apply plugin: 'com.android.application'

android {
 compileSdkVersion 26
    defaultConfig {
    applicationId "com.example.longrowrecyclerviewapp.recyclerviewapp"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
 "android.support.test.runner.AndroidJUnitRunner"
 }
 buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

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

It is the screen shot of my android studio

0 个答案:

没有答案