关于Caused by: org.gradle.api.resources.ResourceException: Could not get resource .....

本文解决了在使用Gradle构建项目时遇到的资源加载错误,通过调整build配置,添加mavenCentral()和mavenLocal()仓库,成功解决了'Could not get resource'的问题。

项目之前还好好的,今天跑起来不知道怎么突然报Caused by: org.gradle.api.resources.ResourceException: Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.3.0/kotlin-stdlib-1.3.0.jar'.

找了一天,终于解决,话不多少。

把原有build配置

allprojects {

    repositories {

        jcenter()

        google()

    }

}

改为

allprojects {

    repositories {

        //新加

        mavenCentral()

        jcenter()

        //新加

        mavenLocal()

        google()

    }

}

 

成功!!!!!!

解决报错finished Download info :prepareKotlinBuildScriptModel org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve gradle:gradle:8.13. org.gradle.api.resources.ResourceException: Could not get resource 'https://services.gradle.org/distributions/gradle-8.13-src.zip'. org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://services.gradle.org/distributions/gradle-8.13-src.zip'. org.gradle.internal.resource.transport.http.HttpRequestException: Got socket exception during request. It might be caused by SSL misconfiguration java.net.SocketException: Connection reset org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve gradle:gradle:8.13. org.gradle.api.resources.ResourceException: Could not get resource 'https://services.gradle.org/distributions/gradle-8.13-src.zip'. org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://services.gradle.org/distributions/gradle-8.13-src.zip'. org.gradle.internal.resource.transport.http.HttpRequestException: Got socket exception during request. It might be caused by SSL misconfiguration java.net.SocketException: Connection reset org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve gradle:gradle:8.13. org.gradle.api.resources.ResourceException: Could not get resource 'https://services.gradle.org/distributions/gradle-8.13-src.zip'. org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://github.com/gradle/gradle-distributions/releases/download/v8.13.0/gradle-8.13-src.zip'. javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
09-06
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值