0

I’m facing a persistent issue when running my Flutter iOS app on a physical iPhone and iOS simulator (iOS 26.1). I am using the latest Flutter and Dart versions and my project is integrated with Firebase Storage and Firebase Core.

The app builds successfully using Xcode, but when it launches on the device, Firebase fails to initialize and the app crashes with the following error:


Xcode build done.                                           234.3s
flutter: ❌ Firebase initialization failed: PlatformException(channel-error, Unable to establish connection on channel., null, null)
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      FirebaseCoreHostApi.initializeCore (messages.pigeon.dart:210:7)
#1      MethodChannelFirebase._initializeCore (...)
#2      MethodChannelFirebase.initializeApp (...)
#3      Firebase.initializeApp (...)
#4      initializeFirebase (main.dart:72)
#5      main (main.dart:37)

What I already tried

  • Updated Flutter to the latest stable

  • Updated Dart

  • Reinstalled iOS dependencies

  • Removed and re-added Firebase using Swift Package Manager

  • Cleaned Xcode build folder (Shift + Cmd + K)

  • flutter clean / flutter pub get

  • Verified GoogleService-Info.plist inside Runner target

Environment

  • Flutter: latest stable

  • Dart: latest

  • iPhone: iOS 26.1

  • Firebase Core / Storage

  • macOS: Tahoe (M2)

What I need help with

  • Why does Firebase fail with PlatformException(channel-error) on a physical device and iOS simulator?

  • Is there a known issue with iOS 26.1 and Firebase initialization?

  • How to properly clean/remove and re-add Firebase when Xcode blocks deleting package dependencies?

Any guidance would really help. Thank you!

1
  • Not sure if it's related or not, but recent versions of Firebase require at least iOS 15 Commented Nov 20 at 22:55

1 Answer 1

-1

PlatformException errors like this happen when Flutter tries to communicate with a plugin over a method channel, but the native side isn’t registered or responding.
Verify GeneratedPluginRegistrant within the AppDelegate.swift is being registered or not. If not try to add:

GeneratedPluginRegistrant.register(with: flutterEngine)
Sign up to request clarification or add additional context in comments.

5 Comments

The GeneratedPluginRegistrant is already in AppDelegate.swift, but I still can’t fix the issue. What else could be causing it?
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
Do you have WidgetsFlutterBinding.ensureInitialized(); before firebase initialization?
Yes, my code is like what you mentioned. Do you mean that this is causing the issue?
void main() async { WidgetsFlutterBinding.ensureInitialized(); // 1️⃣ Initialize Firebase before anything else await initializeFirebase(); SplashServices.checkLogin(); runApp( MultiProvider( providers: [ ChangeNotifierProvider.value(value: themeProvider), ChangeNotifierProvider.value(value: settingsProvider), ], child: const MyApp(), ), ); }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.