Android(安卓)Studio报错:unable to find valid certification path to requested target
16lz
2021-01-26
刚刚接触Android Studio,就遇到了这样的问题:
unable to find valid certification path to requested target
有的博客
说这是缺少证书导致的,但是很遗憾在我这里并没有得到解决!!!
再次经过我的努力,终于找到了解决办法
1、打开Project的build.gradle,将jcenter()删掉,换成:
jcenter{ url 'http://jcenter.bintray.com' }
2、打开build.gradle(Module:app)文件,注释掉以下两个代码块:
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' })
和
testCompile 'junit:junit:4.12'
再在最后加上代码块:
repositories { maven { url 'http://repo1.maven.org/maven2' }}
大功告成,就可以运行了,点个赞呗
更多相关文章
- Android让手机主动亮屏的代码
- 如何在代码中动态设置字体大小
- Android笔记使用Jsoup解析Html
- Android(安卓)opengl es 2.0怎么学习
- Android控件(View)之TextView, Button, ImageButton, ImageView,
- Android(安卓)Widget开发案例(伦敦奥运会倒计时!)
- Android(安卓)Studio(二):基本配置
- 平安金融科技移动技术周报(第六期)
- Android(安卓)logback代码配置详解