jitpack.io failed to resolve github repo

帅比萌擦擦* 提交于 2019-11-28 06:44:04
SteveMellross

For anyone else that made the simple mistake I made:

Ensure you add the maven { url "https://jitpack.io" } under allprojects instead of buildscript. XD

Project build.gradle file:

buildscript {
    repositories {
        jcenter()
        // DO NOT ADD IT HERE!!!
    }
    ...
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        // ADD IT HERE
        maven { url "https://jitpack.io" }
    }
}

Thanks to Alexander Pacha for pointing that out in a comment above.

After a few attempts and thanks to jitpack support now I can import my library hosted in Github as a Android Gradle dependency.

I will provide a a few very useful links:

How setup your java library

https://jitpack.io/docs/BUILDING/#gradle-projects

How check logs of your dependency in jitpack

https://jitpack.io/com/github/USER/REPO/TAG/build.log

In my case

https://jitpack.io/com/github/rchampa/DropboxHttpConector/1.0.3/build.log

I have several dependencies from Jitpack and I encountered this issue after migrating to Gradle 2.

The solution in my case was to change the version in distributionUrl in gradle-wrapper.properties from 2.10 (which was automatically set by Studio when I accepted updating the wrapper version) to the latest one.

I meet this problem when I try to import orhanobut/logger from github. Then I go to jitpack.io and search for the package: find logger in jitpack Then I clicked the log icon,and found:

Start: Thu Jan 14 11:56:56 UTC 2016 Git:v1.9 commit 5abbc1563422457d4c23e1a0a412d2b0c7dc334e Merge: 8ef1e6b 522d44d Author: Orhan Obut Date: Mon May 25 11:34:20 2015 +0200

Merge pull request #30 from orhanobut/oo/settings-fix submodule status: Run gradle build Gradle build script Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 Downloading https://services.gradle.org/distributions/gradle-2.2.1- all.zip

So this is it,it use gradle 2.2.1-all!

Then I go to my project and change gradle version to 2.2.1 in settings.gradle, everything worked fine!

Hallelujah I got the problem!

So I realised that PROBLEM is relied on my NETWORK! I can't acces https://jitpack.io/ from my IP that's why nothing was working. Just shared internet from a GSM module(to get a different IP) and problem is gone using @SteveMellross solution

Maybe it can be 0.001% that you have the same problem but if nothing works just try to access https://jitpack.io/ ;)

I hope there is just a firewall or internal router error and my IP is not banned by their service.

Bacar Pereira

Verify that maven { url "https://jitpack.io" } is in allprojects section in build.gradle (Project)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!