Android Studio / Intellij, Gradle Error:Cause: pee

2019-01-17 08:15发布

Having a fight with intelliji at the moment. The darn thing won't download me gradle 2.1.

I have an Android project hosted on github, which I have cloned to my laptop. I have got working SSL certificates, I know this as I can download SDK software from google using SSL, and I can also download gradle 1.12. What I cannot download is gradle 2.1. (I can download gradle 2.1 using my web browser)

The message I have recieved from intellij is the rather infamous Error:Cause: peer not authenticated error.

From the terminal running intellij I get this:

    * What went wrong:
A problem occurred configuring root project 'XXXXXXX'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:0.13.0.
     Required by:
         :XXXXXXX:unspecified
      > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/0.13.0/gradle-0.13.0.pom'.
         > peer not authenticated

(The XXXXXX's are to hide the identity of the application - it's not an error)

It hasn't got a reason to fail - yet it does. I have search far and wide across the internet, with no avail. Please help me wise SO guru's!

9条回答
劳资没心,怎么记你
2楼-- · 2019-01-17 08:57

Like BzH :

This is a Java SSL connection error I solved on Github here.

You need to add the appropriate SSL certificate to the java keystore for java accept the connection.

Work fine :)

查看更多
何必那么认真
3楼-- · 2019-01-17 09:00

Change your repositories syntax in build.gradle as following. See following question.

repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }
}
查看更多
该账号已被封号
4楼-- · 2019-01-17 09:06

in case when there are some problems with internet try to add a line

54.231.14.232 s3.amazonaws.com

to your /etc/hosts (..\Windows\System32\drivers\etc\hosts)

查看更多
祖国的老花朵
5楼-- · 2019-01-17 09:07

"Error:Cause: peer not authenticated."

As this occurs I using Ubuntu: When I changed version on android studio 2.0 9 preview beta 1.

How do I fix my gradle.

Simply created a new project in android studio and then went in and saw build.grandle version gradle in my case:  

 dependencies {
         classpath 'com.android.tools.build:gradle:2.0.0-beta1'
     }

and replace in my project.

I hope it helps others.

查看更多
干净又极端
6楼-- · 2019-01-17 09:11

When I updated to Android Studio 1.0 I found that I need to update to use 1.0.0 version of gradle.

Inside of the build.gradle file I had

  dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0-rc2'

I changed it to remove the "-rc2"

  dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
查看更多
一夜七次
7楼-- · 2019-01-17 09:15

yeah I experienced exactly same situation It is not easy, but now I'm clear

I changed the build.gradle located in project forlder, not in app folder

I changed as below

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

instead of

repositories {
    jacenter()
}
查看更多
登录 后发表回答