Home > Mobile >  Flutter app run issue - FAILURE: Build failed with an exception
Flutter app run issue - FAILURE: Build failed with an exception

Time:01-25

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.

CodePudding user response:

It's an error due to the latest version of Gradle used in the project.platform_device_id Package contains a lower Gradle and Kotlin version that is not supported to build with the latest Gradle version.

There's also a GitHub issue ongoing, you can check it out with this link

The solution is to use this plugin called device_info_plus instead. It is presented by the Flutter community itself so it works seamlessly as you expected. Also, it works will all platforms.

CodePudding user response:

Upgrade your kotlin veriosn:

ext.kotlin_version = '1.6.21'
  • Related