更新到android studio preview 3.0 canary 3后无法生成项目

更新到android studio preview 3.0 canary 3后无法生成项目,android,android-studio,android-studio-3.0,Android,Android Studio,Android Studio 3.0,我刚刚更新了我的android studio预览版3.0金丝雀3。在此之后,我试图运行该项目,但显示以下错误 Error:Could not find com.android.tools.build:gradle:3.0.0. Searched in the following locations: file:/opt/android-studio-preview/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradl

我刚刚更新了我的android studio预览版3.0金丝雀3。在此之后,我试图运行该项目,但显示以下错误

Error:Could not find com.android.tools.build:gradle:3.0.0.
Searched in the following locations:
    file:/opt/android-studio-preview/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
    file:/opt/android-studio-preview/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Required by:
    project :

您需要做的主要事情是:

将项目级别
build.gradle
文件更改为:

buildscript {
    repositories {
        ...
        // You need to add the following repository to download the
        // new plugin.
        maven {
          url 'https://maven.google.com'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
    }
}
将gradle-wrapper.properties的
distributionUrl
更改为当前可用的最新版本的gradle

distributionUrl=https://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip

完成这些步骤后,您的项目还无法编译,您需要按照所有说明将应用程序
build.gradle
转换为新插件。您需要做的主要事情是:

将项目级别
build.gradle
文件更改为:

buildscript {
    repositories {
        ...
        // You need to add the following repository to download the
        // new plugin.
        maven {
          url 'https://maven.google.com'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
    }
}
将gradle-wrapper.properties的
distributionUrl
更改为当前可用的最新版本的gradle

distributionUrl=https://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip

完成此步骤后,您的项目还无法编译,您需要按照所有说明将应用程序
build.gradle
转换为新插件根据更新更改
build.gradle(项目名称)
的一行(
classpath
):-

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha3'

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

根据更新更改
build.gradle(项目名称)
的一行(
classpath
):-

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha3'

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

您应该阅读此处以确保已正确迁移到新插件:我将问题回滚到原始问题,您不应该在提问后更改问题。您应该阅读此处以确保已正确迁移到新插件:我将问题回滚到原始问题,你不应该在提问后改变问题。