[SOLVED] Unhandled Exception: PlatformException(null-error, Host platform returned null value for non-null return value., null, null)


This Content is from Stack Overflow. Question asked by Oussamovic

i got this Error i didn’t know how i would to solve it any solution Please.

when i initialise firebase im main function it show me this white screnn and flutter icon:

enter image description here

enter image description here

but when i delete this initliation this firebase app run successfully as it is:

enter image description here

and show me those errors

enter image description here


Make sure you have firebase_core in your pubspec.yaml
Then, just use the following in your main:

await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,


flutter clean


flutter pub get

in your terminal.

If it still fails, please go step by step following the firebase documentation. It should work. https://firebase.google.com/docs/flutter/setup?platform=android

This Question was asked in StackOverflow by Oussamovic and Answered by Md. Kamrul Amin It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?