gpt4 book ai didi

android - Gradle 自定义存储库和依赖解析

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:04:10 24 4
gpt4 key购买 nike

我正在开发的项目需要 scribe-javacrashlytics图书馆。这两个库都可以从自定义存储库中获得。

build.gradle 看起来像:

buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}

dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'android'
apply plugin: 'crashlytics'
repositories {
// is required by Crashlytics library
maven { url 'http://download.crashlytics.com/maven' }
// is required by Scribe library
maven { url 'https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/' }
}

....

dependencies {

compile 'com.android.support:support-v4:+'

compile 'com.crashlytics.android:crashlytics:1.+'
...
// OAuth/OAuth2
compile 'org.scribe:scribe:1.3.6'
...
}

有了这样的设置,存储库解析会在构建过程中变得困惑,以至于 gradle 会尝试从不合适的存储库中解析 Artifact :

Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/crashlytics/android/crashlytics/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/crashlytics/android/crashlytics/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nineoldandroids/library/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nineoldandroids/library/]
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/android/support/appcompat-v7/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/android/support/appcompat-v7/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/crashlytics/android/crashlytics/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/crashlytics/android/crashlytics/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nineoldandroids/library/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nineoldandroids/library/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/android/support/appcompat-v7/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/android/support/appcompat-v7/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/crashlytics/android/crashlytics/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/crashlytics/android/crashlytics/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nineoldandroids/library/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nineoldandroids/library/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/android/support/appcompat-v7/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/android/support/appcompat-v7/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/crashlytics/android/crashlytics/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/crashlytics/android/crashlytics/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nineoldandroids/library/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/nineoldandroids/library/]
Resource missing. [HTTP GET: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/android/support/appcompat-v7/maven-metadata.xml]
Failed to get resource: GET. [HTTP HTTP/1.1 400 Bad Request: https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/com/android/support/appcompat-v7/]

它尝试从 scribe 存储库中检索 crashlytics 文件。

最佳答案

按照声明的顺序搜索存储库,直到找到依赖项。如果在 scribe 库中搜索到 crashlytics 库,则表示在 crashlytics 库中找不到它。

关于android - Gradle 自定义存储库和依赖解析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23543710/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com