skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. I had the same problem, my error was:

    Connecting to VM Service at ws://127.0.0.1:58547/pz_fzr28_Hc=/ws
    E/flutter ( 9471): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(java.lang.Exception: Failed to load FirebaseOptions from resource. Check that you have defined values.xml correctly., Exception, Cause: null, Stacktrace: java.lang.Exception: Failed to load FirebaseOptions from resource. Check that you have defined values.xml correctly.
    

    I followed this instruction, as I saw on YouTube, but the correct is here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search