简体   繁体   中英

How to fill the value in build.gradle in Android studio?

There are lines in build.gradle file

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.21'
    }

However, when building the project, the error notes say, "Error:Could not find com.android.tools.build:gradle:1.21."

So how to find the gradle number that installed in my Android Studio?

Source code is from the official training: Developer site

Your gradle plugin version is incorrect. Try this:

dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
    }

Try to add (+) sign for the latest version:

buildscript {
repositories {
    mavenCentral()
}

dependencies {
    classpath 'com.android.tools.build:gradle:0.12.+'
}

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