11

从使用 Crashlytics maven repo 升级到新的 Fabric maven repo 和 gradle 插件后,我的 gradle 构建变得异常缓慢。

该问题似乎是由 Fabric maven 存储库在 gradle 尝试解决依赖项时返回 401 未经授权的错误引起的:

Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/recyclerview-v7/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/appcompat-v7/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/support-v4/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/google/android/gms/play-services/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/support-annotations/21.0.2/support-annotations-21.0.2.pom]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/mediarouter-v7/19.0.1/mediarouter-v7-19.0.1.pom]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/support-annotations/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/recyclerview-v7/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/appcompat-v7/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/android/support/support-v4/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized: https://maven.fabric.io/repo/com/google/android/gms/play-services/maven-metadata.xml]

旧的 Crashlytics maven repo 没有返回这些结果。

有没有人遇到过类似的错误,或者找到了解决方法?

4

1 回答 1

34

来自 Fabric 的 Hemal。

在 build.gradle 中找到这个(应该是 2 个实例):

maven { url ' https://maven.fabric.io/repo ' }

并替换为:

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

于 2014-11-25T15:29:17.373 回答