gpt4 book ai didi

flutter - 编译Flutter项目时出现Gradle错误

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

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

我的代码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

最佳答案

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 - 编译Flutter项目时出现Gradle错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61492465/

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