gpt4 book ai didi

android - Gradle同步失败:找不到com.android.tools.build

转载 作者:行者123 更新时间:2023-12-03 05:12:46 26 4
gpt4 key购买 nike

无法同步gradle。

Error:Could not find com.android.tools.build:gradle:1.0.0. Searched in the following locations: file:/E:/installed/androidsdk/gradle/m2repository/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.pom file:/E:/installed/androidsdk/gradle/m2repository/com/android/tools/build/gradle/1.0.0/gradle-1.0.0.jar Required by: :QuickFoods-android-master:unspecified



应用程序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
}

最佳答案

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

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

关于android - Gradle同步失败:找不到com.android.tools.build,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41642157/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com