am getting this error.
Unhandled Exception: PlatformException(null-error, Host platform returned null value for non-null return value., null, null)
I have updated all firebase packages in .yaml, i still have this error
E/flutter (11230): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(null-error, Host platform returned null value for non-null return value., null, null)
E/flutter (11230): #0 FirebaseCoreHostApi.optionsFromResource (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:242:7)
E/flutter (11230): <asynchronous suspension>
E/flutter (11230): #1 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:89:25)
E/flutter (11230): <asynchronous suspension>
E/flutter (11230): #2 Firebase.initializeApp (package:firebase_core/src/firebase.dart:40:31)
E/flutter (11230): <asynchronous suspension>
E/flutter (11230): #3 main (package:mossbets/main.dart:22:3)
E/flutter (11230): <asynchronous suspension>
E/flutter (11230):
Let me also add i have made the call to initialize firebase. Once i remove the initialisation the app works fine but without firebase
2
Answers
add these two lines to your main.dart main function
This is probably caused by the new changes with Firebase CLI with firebase options. So to solve this do add :
in your terminal
then in your
main
You probably going to be asked to authenticate your firebase account so you’ ll run this in your terminal
this article will help you…start from step 4 Article