Android Studio Gradle Sync与公司代理失败:无法找到有效的证书路径 [英] Android Studio Gradle Sync failed with company proxy: unable to find valid certification path

查看:1741
本文介绍了Android Studio Gradle Sync与公司代理失败:无法找到有效的证书路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要你的帮助。我必须在公司制作Android应用程序,并且在运行和配置Android Studio时遇到一些问题。网络使用代理(来自Zscaler),我无法从Gradle脚本同步项目。

I need your help. I have to make an Android app in a company and have some problems to run and configure Android Studio. The network uses a proxy (from Zscaler) and I can't synchronize project from Gradle scripts.

管理员已经向我提供了代理地址和检查连接设置,使用 build.gradle 脚本中的2个下载域成功连接。但它不适用于Gradle同步。

The administrator have given to me the proxy address and on check connection settings, connection is successful with the 2 download domains from the build.gradle scripts. But it doesn't work on Gradle sync.

以下错误:
正常情况下 build.gradle


  • Could not GET: "https://dl.google.com.dl/android/maven2/"
  • Could not GET: "https://jcenter.bintray.com/

使用maven块上的http:无法获取(来自带有
http的jcenter二进制文件)

With http on maven blocks: Could not GET (From jcenter binary with http)

无法使用找到有效的证书路径。

Unable to find valid certification path.

我还从公司手动导入证书,但它不起作用。
您可以查看图片以显示我尝试过的配置,但它不起作用。

I have also import manually certificates from the company, but it doesn't work. You can look on images to show you my configuration I have tried, and it doesn't work.

图片链接:


  1. https://ibb.co/bJxT9d

  2. https://ibb.co/e7wMUd

  3. https://ibb.co/inro9d

  4. https://ibb.co/gic6vJ

  5. https://ibb.co/eS04hy

  6. https://ibb.co/bOfLNy

  1. https://ibb.co/bJxT9d
  2. https://ibb.co/e7wMUd
  3. https://ibb.co/inro9d
  4. https://ibb.co/gic6vJ
  5. https://ibb.co/eS04hy
  6. https://ibb.co/bOfLNy

请帮帮我,这非常重要。否则我无法做到目标。

Help me please, it's extremely important. I can't do the objectives otherwise.

推荐答案

您需要将公司代理证书注入java尝试的cacerts密钥库中下载文件。这可能是随Android Studio提供的OpenJDK版本或操作系统使用的版本。

You need to inject your companies proxy cert into the cacerts keystore of the java attempting to download files. This may be either the OpenJDK version that is supplied with your Android Studio or the one being used by the operating system.

Keytool位于/ jre / bin

Keytool is located in /jre/bin

cacerts文件位于/ jre / lib / security

The "cacerts" file is located in /jre/lib/security

运行以下内容

keytool -importcert -file <path to cert> -keystore <path to cacerts>
-alias <anything>

系统会提示您输入密码,默认为changeit

You'll be prompted for the password, default is "changeit"

然后会询问您是否信任该证书,请键入yes。

You'll then be asked if you trust the cert, type yes.

这篇关于Android Studio Gradle Sync与公司代理失败:无法找到有效的证书路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆