gpt4 book ai didi

android - 错误 :Could not find com. android.tools.build :gradle:2. 1.0-alpha1

转载 作者:行者123 更新时间:2023-11-29 01:21:48 25 4
gpt4 key购买 nike

我更新了我的 android studio 并重新启动它,它工作正常但是当我尝试导入我以前的项目时它显示类似这样的错误:

这是错误的快照...

Error during import the project

这是我的 gradle 文件...

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

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-alpha1'

// 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
}

最佳答案

尝试使用其他 gradle 发行版。

打开 gradle-wrapper.properties,它位于 gradle/wrapper 文件夹中,并在 distributionUrl 中设置另一个有效的,例如:

 distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip

编辑

尝试在全局 build.gradle 中使用这个类路径

dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'

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

关于android - 错误 :Could not find com. android.tools.build :gradle:2. 1.0-alpha1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36398073/

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