我刚刚在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
我正在使用:
此外,我使用的是公司网络,但是我没有问题直接从Chrome下载程序包。
按照this issue上的一些说明,我尝试:
mavenCentral()
和maven { url 'https://maven.google.com' }
进行build.gradle
在this question之后,我尝试:
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()
}
}
所以,我过去的几个小时都在寻找答案,希望有人能帮助我。