简体   繁体   中英

AS 3.1.3 gradle-4.1-all.zip Could not find com.android.tools.build:gradle:3.0.1

the build.gradle file content:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.novoda:bintray-release:0.8.1'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
    }
}
allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
        google()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}
ext {
    compileSdkVersion = 26
    buildToolsVersion = "26.0.2"
    minSdkVersion = 16
    targetSdkVersion = 26

    lib_appcompat_v7 = 'com.android.support:appcompat-v7:26.1.0'
    lib_support_v4 = 'com.android.support:support-v4:26.1.0'
    lib_support_design = 'com.androdi.support:design:26.1.0'
}

sync failed. error like this:

Could not find com.android.tools.build:gradle:3.0.1. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar Required by: project :thirdLibrary:WordPressEditor

(1) Place google() upon jcenter(). Then Sync project again.

(2) Check if you have offline mode disabled in File> Setting > Build, Execution... > Gradle > Offline work . ( Uncheck this box )

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.novoda:bintray-release:0.8.1'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
    }
}
allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}
ext {
    compileSdkVersion = 26
    buildToolsVersion = "26.0.2"
    minSdkVersion = 16
    targetSdkVersion = 26

    lib_appcompat_v7 = 'com.android.support:appcompat-v7:26.1.0'
    lib_support_v4 = 'com.android.support:support-v4:26.1.0'
    lib_support_design = 'com.androdi.support:design:26.1.0'
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM