Gradle Could not HEAD https://..pom > peer not authenticated

半腔热情 提交于 2019-11-27 07:36:47

Change your repository syntax to one of the following

repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }
}


repositories {
    maven  {
        url "http://repo1.maven.org/maven2"
    }
}

Current (2.1) gradle docs claims that

Warning: Be aware that the central Maven 2 repository is HTTP only 
and HTTPS is not supported. If you need a public HTTPS enabled 
central repository, you can use the JCenter public repository 
(see Section 51.6.3, “Maven JCenter repository”).

I think maven central went for https. If I use following syntax.

repositories {
    mavenCentral()
}

I get following error.

D:\tools\gradle-2.1-bin\bin\gradle.bat -q

FAILURE: Build failed with an exception.

Solution 4 “Peer Not Authenticated” while adding maven "jitpack.io" in app's gradle.build.

Simple solution is install java 8 if you have lower version. We tried with Oracle java8 and it works. :)

Note : Tried a lot of solutions those are on stackoverflow.com but none of them work for me.

Stephan Dhaene

I've updated the gradle wrapper to version 2.4, by changing the gradle-wrapper.properties file from:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip

to:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip

This solved it for me.

I had this problem with Travis and updating gradle version (I was using gradle wrapper) solved. I was using Gradle 2.7, then I put this on build.gradle:

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