1

I've just configured Firebase for use with my app, and now when I try to build, Gradle throws me an error. I've tried deleting pubspec.lock and running pub get, and I have not seen any errors in my code. Does anyone know what might be causing this?

Any and all help is appreciated. TIA :)

Jinto Joseph
  • 947
  • 6
  • 23
Lloyd7113
  • 13
  • 3

2 Answers2

0

I don't have enough rep to just comment... Please check this answer Why is riverpod failing even to initialize in project? Method not found: 'Error.throwWithStackTrace' and see if upgrade Flutter/Dart to at least 2.10/2.16 solves your problem.

pWasmund
  • 38
  • 4
0

You might have to run flutter clean so it deletes your pubspec lock file and the build folder

Then you run flutter pub get to get depencies

The error might also be coming from your firebase configuration. Crosscheck it again

In the android/app/build.gralde file

make sure that your minSdKVersion is >= 21. It is very important when you add some Firebase packages

make sure you have multidexEnable set to true

Baimam Boukar
  • 908
  • 5
  • 20