简体   繁体   English

Flutter 应用程序运行问题 - 失败:构建失败并出现异常

[英]Flutter app run issue - FAILURE: Build failed with an exception

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

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':platform_device_id' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

* 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 26s
Exception: Gradle task assembleDebug failed with exit code 1

In.yaml file platform_device_id: ^1.0.1 ',I need to fix app run issues. In.yaml file platform_device_id: ^1.0.1 ',我需要修复应用程序运行问题。

It's an error due to the latest version of Gradle used in the project.项目中使用的最新版本Gradle导致报错。 platform_device_id Package contains a lower Gradle and Kotlin version that is not supported to build with the latest Gradle version. platform_device_id Package 包含较低的 Gradle 和 Kotlin 版本,不支持使用最新的 Gradle 版本构建。

There's also a GitHub issue ongoing, you can check it out with this link还有一个 GitHub 问题正在进行中,您可以通过此链接查看

The solution is to use this plugin called device_info_plus instead.解决方案是改用这个名为device_info_plus插件 It is presented by the Flutter community itself so it works seamlessly as you expected.它由 Flutter 社区本身提供,因此它可以像您预期的那样无缝运行。 Also, it works will all platforms.此外,它适用于所有平台。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM