In my flutter project that is connected to Firebase, I can run the signup and the signin pages without any problems on IOS. However, with Android, I see the following problems on the debug console:
Connecting to VM Service at ws://127.0.0.1:64170/arF7rSsBtVk=/ws
E/flutter ( 4695): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(java.lang.Exception: Failed to load FirebaseOptions from resource.
google-services.json is located correctly at android/app. When I run it on android emulator, I see a blank page with these problems. what can I do about this?
I checked the packages names and saw no discrepancies.
2
Answers
First check the pubspec.yaml file and check if the versions of Firebase packages are up to date.
Check the gradle versions and compatabilities.
Try
flutter clean
and refresh the project.Try testing it on a real device, sometimes it might not work with the virtual devices.
I had the same problem, my error was:
I followed this instruction, as I saw on YouTube, but the correct is here