我正在尝试使用gradle和jitpack的库的分支。我有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没有模块。这可能从哪里来?
最佳答案
我终于解决了我的问题。
检查jitpack构建日志为我提供了有关该问题的更多信息:https://jitpack.io/com/github/philippeauriach/ChatKit/jitpack-compile-a17dd57690-1/build.log
(Jitpack日志URL为https://jitpack.io/com/github/USER/REPO/TAG/build.log)
我丢失了一些文件(尤其是jitpack所需的包装jar文件,如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,需要提交它们。