Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.8.1) 和(okio-1.8.0.jar)

运行报错之:Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.8.1)

 Unable to resolve dependency for ':app@ReleasesDebug /compileClasspath':
 Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.8.1) Open File Show Details

gradle 里面加上这句


buildscript {
    repositories {
        mavenCentral()
        jcenter()
        google()
    }
allprojects
allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()    
    }
}

最后解决

如果以上还不能解决 那就自己导入jar包吧 反正我是这么解决的
需要 okhttp-3.5.0.jarokio-1.8.0.jar 私密我就可以了

猜你喜欢

转载自blog.csdn.net/Life_s/article/details/104935550