Android jitpack不会从我的repo构建

时间:2017-08-09 10:09:20

标签: android github android-gradle jitpack

我正在尝试使用gradle和jitpack来使用库的fork。我有jitpack.io存储库设置(并使用另一个库的另一个fork)。

我想要包含的新分叉如下:https://github.com/philippeauriach/ChatKit/tree/allow-moving-item

jitpack网站很好看:https://jitpack.io/#philippeauriach/ChatKit/allow-moving-item-SNAPSHOT

但是当我将compile 'com.github.philippeauriach:ChatKit:allow-moving-item-SNAPSHOT'添加到我的gradle依赖文件时,它会显示

12:03   Gradle sync failed: Could not find com.github.philippeauriach:ChatKit:allow-moving-item-SNAPSHOT.
            Required by:
            project :app
            Consult IDE log for more details (Help | Show Log)

使用./gradlew assembleDebug --info我得到以下日志:

Resource missing. [HTTP GET: https://jcenter.bintray.com/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-SNAPSHOT.pom]
Resource missing. [HTTP HEAD: https://jcenter.bintray.com/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-SNAPSHOT.jar]
Resource missing. [HTTP GET: https://maven.fabric.io/public/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/maven-metadata.xml]
Resource missing. [HTTP GET: https://maven.fabric.io/public/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-SNAPSHOT.pom]
Resource missing. [HTTP HEAD: https://maven.fabric.io/public/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-SNAPSHOT.jar]
Resource missing. [HTTP GET: http://dl.bintray.com/amulyakhare/maven/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/maven-metadata.xml]
Resource missing. [HTTP GET: http://dl.bintray.com/amulyakhare/maven/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-SNAPSHOT.pom]
Resource missing. [HTTP HEAD: http://dl.bintray.com/amulyakhare/maven/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-SNAPSHOT.jar]
Resource missing. [HTTP GET: https://maven.google.com/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/maven-metadata.xml]
Resource missing. [HTTP GET: https://maven.google.com/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-SNAPSHOT.pom]
Resource missing. [HTTP HEAD: https://maven.google.com/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-SNAPSHOT.jar]
Resource missing. [HTTP GET: https://jitpack.io/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-f906bb2db7-1.pom]
Resource missing. [HTTP HEAD: https://jitpack.io/com/github/philippeauriach/ChatKit/allow-moving-item-SNAPSHOT/ChatKit-allow-moving-item-f906bb2db7-1.jar]

这意味着jitpack没有模块。这可能来自哪里?

1 个答案:

答案 0 :(得分:3)

我终于解决了我的问题。 检查jitpack构建日志给了我更多关于这个问题的信息:https://jitpack.io/com/github/philippeauriach/ChatKit/jitpack-compile-a17dd57690-1/build.log (jitpack日志网址为https://jitpack.io/com/github/USER/REPO/TAG/build.log

我遗漏了一些文件(尤其是包装jar文件,jitpack按照here的要求}:Check that you have the Gradle wrapper in your Git repository. If you don’t then create it using the command gradle wrapper and commit it. Also check that the generated gradle-wrapper.jar is not ignored with .gitignore rules.

所以在项目的根目录下运行gradle wrapper会生成这些文件:

gradlew
gradlew.bat
gradle/
    wrapper/
        gradle-wrapper.jar
        gradle-wrapper.properties

需要提交它们才能使用jitpack。