颤振 Gradle 任务

时间:2021-07-22 08:19:41

标签: android flutter dart gradle

我将我的 flutter 项目转移到新机器上,但这个错误让我无法运行应用程序:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find builder-3.3.0.jar (com.android.tools.build:builder:3.3.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.3.0/builder-3.3.0.jar

我删除了我的 .gralde/cache 文件,但它对我不起作用

这是我的 build.gradle 文件:

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(':app')
}

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

1 个答案:

答案 0 :(得分:0)

在 .gradle/wrapper/dists/ 中删除 gradle 二进制文件后。我能够运行我的应用程序,现在它工作正常。