如何使用从浏览器下载的pom文件更新Android studio?

时间:2018-02-09 18:57:28

标签: dependencies pom.xml android-studio-3.0

我得到旧的"无法解决com.android.support ..."错误信息。现在我确定它是Android工作室的网络代理问题,但是我可以从我的浏览器访问https://dl.google.com/dl/android/maven2/com/android/support/constraint/constraint-layout/1.1.0-beta4/constraint-layout-1.1.0-beta4.pom并直接下载...但是我如何使用这个pom手动更新Android工作室这个案例?

Could not resolve com.android.support.constraint:constraint-layout:1.1.0-beta4.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/constraint/constraint-layout/1.1.0-beta4/constraint-layout-1.1.0-beta4.pom'.
      > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/constraint/constraint-layout/1.1.0-beta4/constraint-layout-1.1.0-beta4.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                           > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                                          > unable to find valid certification path to requested target

1 个答案:

答案 0 :(得分:0)

这让我疯了,所以希望我的回答可以帮助别人:

  1. 粘贴这是您的Chrome浏览器: https://dl.google.com/dl/android/maven2/com/android/support/constraint/constraint-layout/1.1.0-beta4/
  2. 您将收到404错误,但您仍然可以下载证书(开发人员工具>安全>查看证书>拖到您的桌面)

    1. 删除您当前的谷歌别名(我的是* .google.com)
    2. keytool -delete -alias * .google.com -keystore / Applications / Android \ Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/security/cacerts -storepass changeit

      1. 将刚刚下载的新证书添加到内置于JRE的Android Studio中:
      2. keytool -import -v -trustcacerts -alias .google.com.cer -file /Users/dz5p4d/Downloads/android_certs/.google.com.cer -keystore / Applications / Android \ Studio .app / Contents / jre / jdk / Contents / Home / jre / lib / security / cacerts -keypass changeit -storepass changeit