Cannot sync with gradle behind proxy, site is not blocked, opens from browser

梦想的初衷 提交于 2020-07-28 04:49:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!