关于gradle:对等方未通过身份验证:在Android Studio中构建应用时出错

peer not authenticated: Error while building app in Android Studio

我一直在尝试构建使用来自fabric.io的crashlytics的应用程序。
但是由于以下提到的错误,构建失败。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:classpath'.
   > Could not resolve io.fabric.tools:gradle:1.+.
     Required by:
         TestProject18July2016:app:unspecified
      > Could not resolve io.fabric.tools:gradle:1.+.
         > Failed to list versions for io.fabric.tools:gradle.
            > Unable to load Maven meta-data from https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml.
               > Could not GET 'https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml'.
                  > peer not authenticated

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.367 secs

我的互联网在代理服务器后面。我都启用了HTTP


经过长时间的努力,我已经找到了解决方法。

实际上是有问题的Maven网址:https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml

被重定向到以下网址:
https://s3.amazonaws.com/fabric-artifacts/public/io/fabric/tools/gradle/maven-metadata.xml

以某种方式在Android Studio中,此重定向失败。因此,在应用程序build.gradle文件中,我替换了Maven网址。
来自

1
  maven { url 'https://maven.fabric.io/public' }

1
 maven { url 'http://s3.amazonaws.com/fabric-artifacts/public' }

哪个解决了我的问题。