Could not download okhttp.jar /gradle-5.1.1-all.zip 下載失敗

使用

gradle-5.1.1-all.zip    
com.android.tools.build:gradle:3.4.2

添加

'com.squareup.retrofit2:converter-gson:2.0.2'總是無法下載
Unable to resolve dependency for ':app@ReleasesDebug/compileClasspath': Could not download okhttp.jar (com.squareup.okhttp3:okhttp:3.8.1) Open File Show Details
解決方法:


buildscript {
    repositories {
        mavenCentral()
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
//        classpath 'com.android.tools.build:gradle:2.2.0-alpha1'
//        classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
 
allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots'
        }
        maven { url "https://jitpack.io" }
    }
}
 
task clean(type: Delete) {
    delete rootProject.buildDir
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章