I’m working on a Flutter project. I’ve been stuck on this error for 72 hours. Could someone please help me? Here is my main.dart file.
void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
runApp(MyApp());
}
While running it, here is the error I obtained :
ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
New contributor
Kizza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.