刚刚接触Android Studio,就遇到了这样的问题:
unable to find valid certification path to requested target
有的博客
说这是缺少证书导致的,但是很遗憾在我这里并没有得到解决!!!
再次经过我的努力,终于找到了解决办法

1、打开Projectbuild.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' }}


大功告成,就可以运行了,点个赞呗

更多相关文章

  1. Android让手机主动亮屏的代码
  2. 如何在代码中动态设置字体大小
  3. Android笔记使用Jsoup解析Html
  4. Android(安卓)opengl es 2.0怎么学习
  5. Android控件(View)之TextView, Button, ImageButton, ImageView,
  6. Android(安卓)Widget开发案例(伦敦奥运会倒计时!)
  7. Android(安卓)Studio(二):基本配置
  8. 平安金融科技移动技术周报(第六期)
  9. Android(安卓)logback代码配置详解

随机推荐

  1. 【linux】循序渐进学运维-CentOS7基本配
  2. 10天入门go语言教程- 常量变量
  3. 深圳高新技术企业认定常见问题及相关材料
  4. 【Linux】循序渐进学运维-day01
  5. 【linux】循序渐进学运维-cp
  6. 【linux】循序渐进学运维-mkdir
  7. CRMEBv4.X微商城/小程序商城/公众号商城/
  8. 【linux】循序渐进学运维-基础命令篇
  9. [linux] 循序渐进学运维-mv
  10. 超5亿Facebook用户的数据被泄露,扎克伯格