Home > Software engineering >  Exception: Gradle task assembleDebug failed with exit code -1. flutter
Exception: Gradle task assembleDebug failed with exit code -1. flutter

Time:03-16

I am trying to run my flutter project, but I am getting this error log:

/D:/applications/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_platform_interface-5.5.0/lib/src/method_channel/utils/exception.dart:12:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
Never convertPlatformException(Object exception, StackTrace stackTrace) {
      ^
3

FAILURE: Build failed with an exception.

* Where:
Script 'D:\applications\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\applications\Flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

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

here is the output for flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19042.1526], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Android Studio
[√] VS Code
[√] Connected device (3 available)

Note: I changed the package name from default to the one I need, if that may help find the bug!

CodePudding user response:

This is probably caused by you using an old version of Flutter in combination with a relatively new version of the package. You can try updating your Dart/Flutter versions, which will likely resolve your issues: https://docs.flutter.dev/development/tools/sdk/upgrading

CodePudding user response:

Try

flutter clean

pub get and then restart app

  • Related