简体   繁体   English

当我尝试运行我的 flutter 应用程序时,运行 gradle 时出现错误

[英]When i am trying to run my flutter app it getting an Error running gradle

i am getting an error when i trying to run the app.当我尝试运行应用程序时出现错误。 please help.请帮忙。 The error in cmd is below - Error running Gradle: ProcessException: Process "C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat" exited abnormally: cmd 中的错误如下 - Error running Gradle: ProcessException: Process "C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat" 异常退出:

FAILURE: Build failed with an exception. FAILURE:构建失败并出现异常。

  • Where: Build file 'C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\app\build.gradle' line: 14其中:构建文件 'C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\app\build.gradle' 行:14

  • What went wrong: A problem occurred evaluating project ':app'.出了什么问题:评估项目“:app”时出现问题。

    ASCII ASCII

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志 output。 Run with --scan to get full insights.运行 --scan 以获得完整的见解。

  • Get more help at https://help.gradle.orghttps://help.gradle.org获得更多帮助

BUILD FAILED in 14s Command: C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat app:properties 14 秒内构建失败命令:C:\Flutter projects\FlatApp-Firebase-Flutter-master\android\gradlew.bat app:properties

Please review your Gradle project setup in the android/ folder.请查看 android/ 文件夹中的 Gradle 项目设置。

line nine in app-build-gradle is below- def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } line nine in app-build-gradle is below- def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties 文件。") }

There could be many reasons for such a error.这种错误可能有很多原因。 I had a similar error.我有一个类似的错误。 I would suggest you to open your project in android studio and check your gradel versions.我建议你在 android 工作室打开你的项目并检查你的等级版本。 I see by the name of you app that you are using firebase.我从您的应用程序名称中看到您正在使用 firebase。 Some of those plugins use Androidx.其中一些插件使用 Androidx。 So migrating your project to Androidx might help.因此,将您的项目迁移到 Androidx 可能会有所帮助。 Here's how to migrate your project to Androidx.以下是如何将您的项目迁移到 Androidx。

Hope it helps!希望能帮助到你!

I had the same issue this may because of the incompatibility of Gradle versions.我遇到了同样的问题,这可能是因为 Gradle 版本不兼容。

I opened the android part in Android Studio and updated Gradle as recommended by Android Studio with Alt+Enter and it solved my problem.我在 Android Studio 中打开了 android 部分,并按照 ZE84E30B9390CDB64DB6DB2C9AB87846D 的建议更新了Alt+Enter并解决了我的问题。

I can elaborate more if you can post more details about it eg your app/gradle file.如果您可以发布有关它的更多详细信息,例如您的 app/gradle 文件,我可以详细说明。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试运行时我的第一个 flutter 应用程序出错 - Getting error in my first flutter app while trying to run 运行旧 Flutter 应用程序时出现 Gradle 错误 - Gradle error when running old Flutter app flutter:第一次运行我的 flutter 应用程序时出现 gradle 错误 - flutter: getting gradle error while running my flutter app for the first time 尝试从gradle运行简单的ant脚本时,我得到“ srcdir不存在” - When trying to run a simple ant script from gradle, I am getting “srcdir does not exist” 当我运行代码 gradle 任务需要太长时间时,我的 flutter 应用程序出现问题 我尝试了 flutter 医生,它说一切都正确,然后错误 - i have problem with my flutter app when i run the code gradle task takes too long i tried flutter doctor ,it says that all things is right ,then error 为什么我在 flutter android 项目中收到 gradle 错误? - Why I am getting gradle error in flutter android project? 尝试运行颤振项目时显示此 Gradle 错误 - showing this Gradle error when trying to run flutter project 尝试运行 flutter 应用程序时,build.gradle 文件中出现错误 - When trying to run flutter application there is a Error in build.gradle file 尝试运行 flutter 运行的 android 应用程序时出错 - Getting error while trying to run android app by flutter run 在我的 flutter 应用程序的 gradle 构建期间出现一个超级奇怪的错误 - Getting a super weird error during gradle build of my flutter app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM