rub*_*com 52 android certificate gradle android-studio
我收到了这个错误
Gradle 'project_name' project refresh failed: Unable to find valid certification path to requested target
当我在Android Studio 0.8.14 Mac OSX上创建一个新项目时
Build.gradle文件似乎变空了
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
allprojects {
repositories {
jcenter()
} }
Run Code Online (Sandbox Code Playgroud)
我无法运行该项目,似乎我必须手动配置所有内容.
这是idea.log http://pastebin.com/kyhfrBp9
Jin*_* Li 64
它发生在我身上,结果是因为Charles Proxy.
Charles Proxy是一个HTTP调试代理服务器应用程序
解决方案(仅当您安装了Charles Proxy时):
Gok*_*kul 24
对我来说问题是android studio无法与' https://jcenter.bintray.com/ ' 建立连接
将此更改为"http"可以解决我的问题(虽然不建议这样做).
在build.gradle文件中,进行更改
repositories {
jcenter()
}
Run Code Online (Sandbox Code Playgroud)
至
repositories {
maven { url "http://jcenter.bintray.com"}
}
Run Code Online (Sandbox Code Playgroud)
Ren*_*eno 21
如果您在受限制的工作场所工作,您可能会遇到此问题
一些事情的组合对我有用基本上将https更改为http
来自https:
repositories {
jcenter()
}
Run Code Online (Sandbox Code Playgroud)
至 :
repositories {
maven { url "http://jcenter.bintray.com" }
}
Run Code Online (Sandbox Code Playgroud)
并在gradle-wrapper.properties......
来自:
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
Run Code Online (Sandbox Code Playgroud)
至 :
distributionUrl=http\://services.gradle.org/distributions/gradle-3.3-all.zip
Run Code Online (Sandbox Code Playgroud)
然后
- (optional) File -> Invalidate Caches / Restart`
- Give a clean build.
Run Code Online (Sandbox Code Playgroud)
验证:检查Gradle控制台.它应该开始通过HTTP从jcenter下载libs.
Car*_*res 21
“无法找到到请求目标的有效认证路径”
如果您收到此消息,则您可能在您公司的代理背后,该代理可能正在使用您公司的根 CA 证书签署所有请求证书,此证书仅在您的公司内部受信任,因此 Android Studio 无法验证任何使用您的签名的证书公司证书有效,因此,您需要告诉 Android Studio 信任您的公司证书,您可以通过将公司证书添加到 Android Studio 信任库来实现。
(我在 macOS 上这样做,但在 Linux 或 Windows 上应该类似)
在弹出窗口中,要将根证书另存为文件,请确保选择证书链的顶层(根证书)并将证书图像拖到磁盘驱动器上的文件夹/目录中。它应该保存为一个文件,例如:my-root-ca-cert.cer或my-root-ca-cert.pem
在Android Studio中打开Preferences -> Tools -> Server Certificates,包装盒上的Accepted certificates点击加号图标(+),搜索你以前保存的证书,然后单击Apply和OK
在 Android Studio 中打开 File -> Project Structure -> SDK Location -> JDK Location
复制JDK Location的路径,打开终端,将你的目录改为该路径,例如执行:
cd /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/
Run Code Online (Sandbox Code Playgroud)
(不要忘记转义空格,“\”)
现在,要将证书导入信任库,请执行:
./bin/keytool -importcert -file /path/to/your/certificate/my-root-ca-cert.cer -keystore ./jre/lib/security/cacerts -storepass changeit -noprompt
Run Code Online (Sandbox Code Playgroud)
File -> Invalidate Caches / Restart完成,您现在应该可以构建您的项目了。
Aks*_*aru 19
好吧,可能我迟到但从3.0升级到3.0.1后我遇到了这个问题.而这个问题是因为我在受限制的网络中工作.
对我有用的解决方案如下:
解
第1步:获取证书
jcenter()等于https://bintray.com/bintray/jcenter
您需要将import jcenter的cerficate导入到您的java密钥库中.
使用浏览器访问jcenter并将证书导出为.cer文件.(Firefox地址栏左侧的锁定图标或Chrome开发人员工具安全选项卡.但Internet Explorer和Edge不支持保存网站证书.)
第2步:导入证书
在Android Studio中,转到File -> Settings -> Tools -> Server Certificates.
在接受证书下单击+.选择导出的证书.
第3步:刷新密钥库在Android Studio中,转到File -> Invalidate Caches/Restart....Invalidate and Restart从显示的消息框中选择.
Ali*_*raf 13
即使这个问题很老,但很多人必须面对同样的问题,所以我想说明我是如何解决这个问题的.
问题是classpath 'com.android.tools.build:gradle:0.13.2'
在build.gradle的上面一行,你要求它找到特定版本的gradle,但是你的机器中没有这个版本.最好将上述行更改为
classpath 'com.android.tools.build:gradle:+'
Run Code Online (Sandbox Code Playgroud)
xia*_*ang 10
jcenter()等于https://bintray.com/bintray/jcenter
您需要将import jcenter的cerficate导入到您的java密钥库中.
脚步:
如果您在gradle.properties中位于代理之后,除了设置
systemProp.http.proxyHost和systemProp.http.proxyPort
也设定
systemProp.https.proxyHost和systemProp.https.proxyPort
到现在为止应该没问题.
小智 7
我在企业环境中使用代理/防火墙/病毒扫描程序组合将公司自己的SSL根证书(自签名)添加到每个SSL连接的信任路径,以调查SSL连接.这正是问题所在.如果您处于相同的情况,此解决方案可以提供帮助:
| 归档时间: |
|
| 查看次数: |
97600 次 |
| 最近记录: |