无法获取资源-PKIX路径构建失败:无法找到到请求目标的有效证书路径

时间:2019-06-05 15:37:40

标签: android gradle flutter pkix

我刚刚在google's oficial documentation之后创建了一个新的flutter应用。

当我第一次尝试运行该应用程序时,出现此错误:

A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.2.1.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.2.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.android.tools.build:gradle:3.2.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

我正在使用:

  • 等级:5.1.1
  • 版本构建:3.2.1

此外,我使用的是公司网络,但是我没有问题直接从Chrome下载程序包。


按照this issue上的一些说明,我尝试:

  • 添加mavenCentral()maven { url 'https://maven.google.com' }进行build.gradle
  • 使用gradle build 3.1.2


this question之后,我尝试:

  • 下载google和jcenter证书,并将其放在Android Studio中。
  • 配置“ gradle.properties”文件
systemProp.http.proxyHost=srvint.poupex.com.br
systemProp.http.proxyPort=80
systemProp.https.proxyHost=srvint.poupex.com.br
systemProp.https.proxyPort=80



我当前的“ build.gradle”文件如下所示:

buildscript {
    repositories {
        google()
        jcenter()
    }

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}


所以,我过去的几个小时都在寻找答案,希望有人能帮助我。

0 个答案:

没有答案