PKIX path building failed: unable to find valid certification path to requested target
AndroidStudio报错PKIX path building failed: unable to find valid certification path to requested target 解决方案:
从错误提示来看:找不到可用证书**。**Android Studio没有获得使用网络的权限,无法访问https://bintray.com/bintray/jcenter。
解决步骤:
1.终极方案:从https://bintray.com/bintray/jcenter获取证书。
第一步,下载狐火浏览器。
第二步,打开https://bintray.com/bintray/jcenter
2.打开之后,可以看到地址栏有一把锁,点开:
3.继续点击更多信息(可能火狐版本不一样,界面会有点不同,如果实在不会,请在“恬恪学习网”关于我们,与我们客服协助)
4.查看其证书:
5.将证书导出,记住自己导出的位置地方:
6.在AndroidStudio中,找到Server Certificates 将证书导入:
7.重启并清理缓存,这一步必做:
8.将gradle文件改成这样:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter{
url 'http://jcenter.bintray.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter{
url 'http://jcenter.bintray.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
还没有评论,来说两句吧...