11

Everything has been working, only today i started to get an error message, and i can't even "Sync Project with Gradle files" from Android Studio. The only thing i have changed was ... the office :D

Error:A problem occurred configuring project ':app'. Could not download library.jar (com.mcxiaoke.volley:library:1.0.16) Could not GET 'https://jcenter.bintray.com/com/mcxiaoke/volley/library/1.0.16/library-1.0.16.jar'. peer not authenticated

And my build.grade

buildscript {
    repositories {
        jcenter()
        maven { url 'http://download.crashlytics.com/maven'}
        maven { url 'http://dl.bintray.com/amulyakhare/maven'}
    }

    dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }
}
....

gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip

I also tried with http instead of https, but still the same problem.

Does anyone have similar problem?

3
  • 1
    jcenter has invalid SSL and brokes all gradle build. Maven works :)
    – MariuszS
    Commented Jun 12, 2015 at 9:14
  • Thanks for the update @MariuszS. What do you mean by: Maven works? What do you suggest to fix this error?
    – Bugdr0id
    Commented Jun 12, 2015 at 9:17
  • 1
    maven is using m2 repository, solution belowa
    – MariuszS
    Commented Jun 12, 2015 at 9:22

7 Answers 7

18

Temporary solution

Add this to build.gradle

repositories {
    mavenLocal()
    maven {
        name "jcenter"
        url "http://jcenter.bintray.com/"
    }
}
2
  • 1
    Disabling https should only be used as a temporary workaround! Commented Jun 12, 2015 at 11:33
  • Yes! This is temporary solution
    – MariuszS
    Commented Jun 12, 2015 at 11:55
7

It seems a temporary issue with jcenter with an invalid SSL.

You can switch to mavenCentral repo in your build.gradle file.

repositories {
     mavenLocal()
     mavenCentral()
}
0
0

The issue occurs when cacerts file gets messed up. After attempting all solutions that I found on the Internet, I could finally resolve this by reinstalling java.

0
0

changing the version of the jdk to the latest version worked for me (Oracle Java 8). This question shows you how to do this on android studio: How to specify the JDK version in android studio?

0

I tried with all the above solutions didn't work, this once helped me lot with latest studio 2.2 preview 7. Make the changes in build.gradle of root project:

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

       }
}
0

Add these properties to your gradle home directory in a new gradle.properties file

systemProp.https.proxyHost=[your proxy https host IP or DNS name]
systemProp.https.proxyPort=[your proxy https port, usually 8080]
systemProp.http.proxyHost=[your proxy http host IP or DNS name]
systemProp.http.proxyPort=[your proxy http port, usually 8080]

OSX: /users/yourusername/.gradle/gradle.properties

Windows: C:\Users\yourusername.gradle\gradle.properties

Then, restart Android Studio and open your project.

Note: I used the same values for HTTP and HTTPS, they could be different from yours.

0

I had this error and it was happening because of a VPN proxy issue. I disabled my VPN and everything worked fine after. I used this command (on a Mac):

sudo /opt/cisco/anyconnect/bin/acwebsecagent -disablesvc -websecurity

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.