问题
I am trying to open a project (developed in a different machine) with my newly installed android studio 2.3
. The studio was downloading gradle-2.1.2.pom
but threw the following error:
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.2/gradle-2.1.2.pom'. Received status code 403 from server: Forbidden
When I try to open the same url above from my browser, it downloads the .pom file, which means the proxy is not blocking it. I have configured the studio with the proxy address and login credentials. Can anyone explain me why is android studio unable to connect to the same site that the browser can open.
Note: I could not find any hint about this in the existing questions about gradle behind proxy, so this new question.
回答1:
I found out the answer. The solution is to add the certificate to the site https://jcenter.bintray.com in Java (follow this link to do so) and restart the android studio. Basically, the site has to be trusted by java runtime for connecting using https
.
来源:https://stackoverflow.com/questions/43177577/cannot-sync-with-gradle-behind-proxy-site-is-not-blocked-opens-from-browser