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 09:17

I've fixed this issue by adding the following to me build.gradle:

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

Once done, try syncing and rebuilding your project. Hope this was helpful.

查看更多
Juvenile、少年°
3楼-- · 2019-01-17 09:20

I've fixed this issue by adding the following to my build.gradle:

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

Once done, try syncing and rebuilding your project. Hope this was helpful.

查看更多
smile是对你的礼貌
4楼-- · 2019-01-17 09:21

you should import the certificate:

First of all download the certificate (.cer) from this url, Help is here

Copy it to the path JDK_HOME/jre/lib/security

Then with command prompt targeted to above location, run the following command:

keytool -import -alias git -file <cert_file_name_you_exported.cer> -keystore cacerts -storepass changeit

Type yes if it prompts for approval, after that open the desired IDEA and have fun :)

If this doesn't help, try importing the certificate to JRE/lib/security/cacerts, It's totally depend on the build path of the IDEA you are using

查看更多
登录 后发表回答