Android Studio 报错提示:Unable to find vaild certification path to request target

详情说明:
Android Studio 报错提示:Unable to find vaild certification path to request target
分析:
服务器无法链接到谷歌库
解决方法:
第一种
解决办法,更换网络,
第二种
解决办法更换maven的地址
Android Studio 报错提示:Unable to find vaild certification path to request target
找到该路径,将repositories和allprojects内的
google()
jcenter()
都改为
mavenCentral()
maven { url ‘http://maven.google.com’ }
maven { url ‘http://jcenter.bintray.com’}
maven {
url ‘http://maven.aliyun.com/nexus/content/groups/public/’
}
CTRL+s保存之后在运行,可以点击一下这个,清理一下缓存
Android Studio 报错提示:Unable to find vaild certification path to request target
第三种
重新下载gradle文件
Gradlr文件的路径:C/User/用户名(可能是数字或英文,也有的是中文)/.gradle
Android Studio 报错提示:Unable to find vaild certification path to request target
直接选中.gradle文件删除,删除之后重新打开AS,运行等待,
第四种
导入证书,我导入的是就jcenter的证书,也可以选择谷歌的
https://jcenter.bintray.com/ 和 http://maven.google.com
将网址输入到地址栏
Android Studio 报错提示:Unable to find vaild certification path to request target
点击地址栏前端锁状图标,点击证书
Android Studio 报错提示:Unable to find vaild certification path to request target
点击复制到文件
Android Studio 报错提示:Unable to find vaild certification path to request target
Android Studio 报错提示:Unable to find vaild certification path to request target
Android Studio 报错提示:Unable to find vaild certification path to request target
随意起个名字,请用英文
Android Studio 报错提示:Unable to find vaild certification path to request target
选择另一个盘符进行保存
回到桌面 Win+r打开运行命令框,输入cmd,点击运行
再控制台找到jre的路径,
这是我的jre路径
Android Studio 报错提示:Unable to find vaild certification path to request target
Android Studio 报错提示:Unable to find vaild certification path to request target
再控制台进入该路径,
然后输入keytool -import -alias as(证书名) -keystore cacers -file d:as.cer(证书路径+证书名+后缀(cer))
Android Studio 报错提示:Unable to find vaild certification path to request target
按照选项进行,其命令前缀未 keytool 后边加上选项“-”也要有
Android Studio 报错提示:Unable to find vaild certification path to request target
若提示库**口令输入:changeit(注意,输入**时控制台不会显示输入的字符,请放心输入)
是否信任:输入y,然后回车
显示导入成功后,关闭控制台,重新打开AS运行
第五种手动依赖更新
打开AS-file- >Project sructure->denpendencies
把里面的依赖全部更新
Android Studio 报错提示:Unable to find vaild certification path to request target
然后重开AS,运行
若是以上五种都无法解决,那么就是第六种非常简单的方法,
第六种,重装系统,
可以去你电脑购买点,一般私人店都会免费帮你重装,官方销售店我不太清楚,可以提前打电话咨询一下,