mo-ah-dawood / fcm_config

10 stars 12 forks source link

E/flutter (19269): [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) #34

Open tebalink opened 9 months ago

tebalink commented 9 months ago

environment: sdk: '>=2.19.6 <3.0.0'

fcm_config: ^3.5.1

E/flutter (19269): [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 (19269): #0 FirebaseCoreHostApi.optionsFromResource (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:248:7) E/flutter (19269): E/flutter (19269): #1 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:89:25) E/flutter (19269): E/flutter (19269): #2 Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:31) E/flutter (19269): E/flutter (19269): #3 FCMConfig.init (package:fcm_config/src/fcm_config.dart:109:5) E/flutter (19269): E/flutter (19269): #4 main (package:ecommerce_2368/main.dart:34:3)

mo-ah-dawood commented 9 months ago

can you please try version 3.5.3

tebalink commented 9 months ago

The same problem

yacine-h-brahim commented 5 months ago

void main() async { WidgetsFlutterBinding.ensureInitialized(); Platform.isAndroid ? await Firebase.initializeApp( options: FirebaseOptions( apiKey: "ApiKey", appId: "AppId", messagingSenderId: "MessagingSenderId", projectId: "ProjectId", ), ) : await Firebase.initializeApp();

runApp(const MainApp()); } -follow this youtube video for more: https://www.youtube.com/watch?v=Qn2ysnVMvEE -happy coding.