Android Studio Gradle build failed. Error:Cause: peer not authenticated

前端 未结 23 1812
离开以前
离开以前 2020-12-03 04:54

I have already created one project and gradle sync worked successfully.

When I try to create another project it fails and gives the error message that



        
23条回答
  •  独厮守ぢ
    2020-12-03 05:20

    Usually this error happens when you're under a company proxy. My solution on MAC was this:

    1. Identify the Certificate is being used by your https connections

    2. Open Key Chain Tools (cmd+space key chain)

    3. Identify the certificate found up and export it to certificate.cer file
    4. Open the terminal and navigate to your JAVA JRE security folder:

      cd /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/security

    5. Import the certificate with the following command:

      sudo keytool -import -alias somealias -file /PATH_TO_EXPORTED_CERTIFICATE/certificate.cer -keystore cacerts -storepass changeit

    That is done. Open Android Studio and it will fix the gradle build.

提交回复
热议问题