【问题标题】:Gradle error when compiling flutter project编译flutter项目时出现Gradle错误
【发布时间】:2020-08-12 23:46:19
【问题描述】:

我正在尝试运行我的颤振应用程序,但它给出了以下 gradle 错误,有人可以帮助我吗?我尝试了一些堆栈自己的解决方案,但没有解决。

我的代码 build.grade 是:

buildscript {
    repositories {
        google()
        jcenter()

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath 'com.google.gms:google-services:4.3.3'
    }

}

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

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

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

这个错误是: Message error

更新

我已经解决了上面的错误,但现在出现这样的错误,

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using 
BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using 
BuildSessionScopeServices.createFileSnapshotter().

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug 
 option to get more log output. Run with --scan to get full insights.

 * Get more help at https://help.gradle.org

 BUILD FAILED in 6s
 Gradle task assembleDebug failed with exit code 1

【问题讨论】:

标签: flutter gradle


【解决方案1】:
FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Gradle task assembleDebug failed with exit code 1

【讨论】:

    猜你喜欢
    • 2021-11-14
    • 2019-08-07
    • 2017-03-14
    • 1970-01-01
    • 1970-01-01
    • 2013-03-04
    • 2021-04-28
    • 1970-01-01
    • 2018-07-10
    相关资源
    最近更新 更多