0

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!

3 Answers3

0

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

fravolt
  • 2,565
  • 1
  • 4
  • 19
  • This is a exact copy of the project I am working on in my same computer. The original one works and has the same flutter and dart version. I need to work on the copy of this project for some technical reasons. And now that there is an error I find it really helpful for my learning experience! – Farrukh Nadeem Mar 15 '22 at 14:48
  • So it turns out the problem was with dependencies! Maybe if I upgraded my dart this problem would have had been solved. But, I found another solution to this in this question: https://stackoverflow.com/questions/71261321/flutter-app-running-on-web-failing-with-error – Farrukh Nadeem Mar 17 '22 at 15:54
0

Try

flutter clean

pub get and then restart app

Evgen
  • 77
  • 6
0

I reread you error, it seems to me, that you get null from firestore

Evgen
  • 77
  • 6