[英]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.org在https://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
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.