Error:Cause: unable to find valid certification path to requested target

前端 未结 22 1077
无人及你
无人及你 2020-11-29 05:47

I got the following Error in android Studio 2.2.3 when I sync gradle.

Error:Cause: unable to find valid certification path to requested target

相关标签:
22条回答
  • 2020-11-29 06:16

    For me this worked:

    buildscript {
        repositories {
            maven { url "http://jcenter.bintray.com"}
            maven {
                url 'https://maven.google.com/'
                name 'Google'
            }
        }
    ...
    }
    
    allprojects {
        repositories {
            mavenCentral()
            jcenter{ url "http://jcenter.bintray.com/" }
            maven {
                url 'https://maven.google.com/'
                name 'Google'
            }
        }
    }
    
    0 讨论(0)
  • 2020-11-29 06:17

    If you are running behind a corporate proxy with SSL interception, you will need to follow these steps to trust your proxy certificate for HTTPS:

    • In Android Studio, Open File -> Settings
      • In Tools -> Server Certificates
        • Tick ‘Accept non-trusted certificates automatically’
        • Also click the ‘+’ and manually add the corporate proxy root certificate.
      • In Appearance and Behaviour -> System Settings -> HTTP Proxy
        • Set your corporate proxy URL and port details
    • Download KeyStore Explorer: http://keystore-explorer.org/downloads.html
    • In KeyStore Explorer (run as admin), open the Android Studio JRE certificate store: C:\Program Files\Android\Android Studio\jre\jre\lib\security\cacerts
      • The password should be ‘changeit’
      • Import the corporate proxy root certificate, and save.
    • In Android Studio, select File -> Invalidate Cache and Restart
    0 讨论(0)
  • 2020-11-29 06:23

    Most of the times when I face this issue. I remove replace https with http. It solves the issue.

    0 讨论(0)
  • 2020-11-29 06:25

    I have faced this problem with Maven build earlier. It was occurring because I was working in a restricted office network. You need to import required certificate in your keystore.

    Follow Steps in the answer of below question "unable to find valid certification path to requested target", but browser says it's OK

    (use double quotes for fienames/pathnames)

    Note: I am not able to find now exact source from where I solved problem, if I get it, I will update it

    0 讨论(0)
  • 2020-11-29 06:25

    Just try to build the same project through command prompt and if the download dependencies happen successfully, go to settings in you IntelliJ and map the gradle to point gradle in your system and build should happen fine.

    0 讨论(0)
  • 2020-11-29 06:26

    Import your company certificate at Tools->Android->SDK Manager->Tools->Server Certificates

    0 讨论(0)
提交回复
热议问题