Android Studio - Unable to find valid certificatio

2019-01-21 16:19发布

I'm getting this error

Gradle 'project_name' project refresh failed: Unable to find valid certification path to requested target

when I create a new project on Android Studio 0.8.14 Mac OSX

Build.gradle file seems to become empty

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.13.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } }

allprojects {
    repositories {
        jcenter()
    } }

And I can't run the project, seems that I have to configure everything manually.

Here is the idea.log http://pastebin.com/kyhfrBp9

21条回答
劳资没心,怎么记你
2楼-- · 2019-01-21 16:36

I had the same issue and it was caused because cyberoam was blocking my following URL

Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml.

查看更多
欢心
3楼-- · 2019-01-21 16:40

I had this problem today after upgrading to Android Studio 3.2 Beta 2. I had configured my JDK for OpenJDK 10.0.1, and it threw this error after upgrading. I set the JDK back to using the enbedded JDK, and the error went away.enter image description here

I have no idea why it worked fine before I upgraded to Beta 2, but all is good now. Honestly I guess there is no need for OpenJDK 10 for Android.

查看更多
看我几分像从前
4楼-- · 2019-01-21 16:41

Try to update your Android Studio, now is version 1.0.2

查看更多
ら.Afraid
5楼-- · 2019-01-21 16:42

Add latest gradle version properly in build.gradle file and latest distributionUrl in gradle-wrapper.properties file. [refer https://developer.android.com/studio/releases/gradle-plugin.html for the latest gradle version of android studio]

Make sure network connectivity is proper [ Network connection should not block upgrading gradle in android studio]. After gradle upgrade android studio will prompt alert to accept/decline certificate and we should accept the certificate.

查看更多
来,给爷笑一个
6楼-- · 2019-01-21 16:42

Go to The Gradle Console in bottom right and open it.Here you will be seeing some https/https calls click on the links and open them in web browser then try clean build it worked for me.

I think It is happening because studio is not able to get the response from the hit.

查看更多
男人必须洒脱
7楼-- · 2019-01-21 16:44

For me it was my internet, I was working on restricted network

查看更多
登录 后发表回答