【问题标题】:how to solve gradle faild sync:SSL handshake connection when trying to download recycleview?尝试下载recyclerview时如何解决gradle失败同步:SSL握手连接?
【发布时间】:2019-07-20 09:17:31
【问题描述】:

我尝试下载 RecycleView 以便在我的项目中使用,但此错误不断出现,下载失败。

Gradle 同步失败:无法解析所有依赖项 配置':app:debugRuntimeClasspath'。无法确定 androidx.recyclerview:recyclerview:1.0.0 的工件不能 获取资源 'https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.aar'。 无法 HEAD 'https://dl.google.com/dl/android/maven2/androidx/recyclerview/recyclerview/1.0.0/recyclerview-1.0.0.aar'。 握手期间远程主机关闭连接 SSL peer close 错误关闭 请参阅 IDE 日志以获取更多详细信息(帮助 | 显示日志) (12 秒 965 毫秒)

这是项目构建 Gradle:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        google()
        maven { url 'http://repo.maven.apache.org/maven2' }
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.2.0'
        // 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
}

这就是 Module:App build Gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "com.aden.adenmarket"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.firebase:firebase-auth:18.0.0'
    implementation 'com.google.firebase:firebase-firestore:20.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
}
apply plugin: 'com.google.gms.google-services'

【问题讨论】:

    标签: java android android-studio


    【解决方案1】:

    由于没有人回答我的问题,我将发布此答案。也许它会帮助可能面临此类问题的人。我通过更新 Firebase 库和 将这两个依赖项更新到最新版本,并且成功运行。

    //module:app
        implementation 'com.google.firebase:firebase-auth:18.1.0'
        implementation 'com.google.firebase:firebase-firestore:20.1.0'
         implementation 'com.google.firebase:firebase-core:17.0.1'
    //project Build Graddle
         classpath 'com.android.tools.build:gradle:3.4.2'
         classpath 'com.google.gms:google-services:4.3.0'
    

    【讨论】:

      猜你喜欢
      • 2014-12-25
      • 1970-01-01
      • 1970-01-01
      • 2020-05-26
      • 2017-08-08
      • 2017-09-09
      • 1970-01-01
      • 2015-07-13
      • 2018-07-28
      相关资源
      最近更新 更多