Gradle Sync失败:找不到com.android.tools.build

时间:2017-01-13 19:32:35

标签: android maven gradle

无法同步草图。

  

错误:找不到com.android.tools.build:gradle:1.0.0。       在以下位置搜索:           文件:/ E:/installed/androidsdk/gradle/m2repository/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.pom           文件:/ E:/installed/androidsdk/gradle/m2repository/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.jar       要求:           :QuickFoods-机器人主:未指定的

App build.gradle文件

apply plugin: 'com.android.application'

apply plugin: 'com.google.gms.google-services'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.android.BiggiesBurger"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.google.firebase:firebase-ads:9.2.1'
    compile 'com.google.android.gms:play-services-appindexing:9.2.1'
  //  compile 'com.google.android.gms:play-services:8.3.0'
}

项目build.gradle文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
      //  classpath 'com.google.gms:google-services:2.1.0'
     //   classpath 'com.google.gms:google-services:3.0.0'

        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:2.0.0-alpha3'

//        classpath 'com.android.tools.build:gradle:2.2.3'
//        //classpath 'com.google.android.gms:play-services:10.0.1'
//       classpath 'com.google.gms:google-services:2.0.0-alpha3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

    }

}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:1)

存储库可能是尝试将jcenter()与maven()和google()一起使用的原因。

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