[firebase_core]: Firebase.initializeApp Start application error
Is there an existing issue for this?
- [x] I have searched the existing issues.
Which plugins are affected?
No response
Which platforms are affected?
iOS
Description
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeCore"., null, null)
#0 FirebaseCoreHostApi.initializeCore (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:301:7)
firebase_core: ^3.15.1 firebase_core_platform_interface: ^6.0.0
Reproducing the issue
Connected to the VM Service.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeCore"., null, null)
#0 FirebaseCoreHostApi.initializeCore (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:301:7)
messages.pigeon.dart:301
Firebase Core version
3.15.1
Flutter Version
3.24.4
Relevant Log Output
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
No response
Hi there, can you show me a snippet of what you are doing and can you confirm you have followed the setup instructions here https://firebase.google.com/docs/flutter/setup?platform=android ?
I got the same issue when using firebase_core: 3.15.2 This is the code that throw the error:
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform);
Just to give an update: The issue disappeared after I ran this command:
flutter clean && flutter pub get
We are getting this same issue in our project. We noticed this problem last week and no code changes were made to our repo. We have done pretty through cleaning and re-installing of dependencies with no luck. @thanhdatvo we didn't run that command together but we typically run through the following steps when switching between different projects that we manage:
Delete pubspec.lock file
Delete Podfile.lock file
Delete Pods folder
Then in Terminal:
flutter pub cache clean
flutter clean
flutter pub get
cd ios
pod deintegrate
pod cache clean --all
pod install (if script yells at you to run pod install --repo-update, do that instead)
Also delete Derived Data folder
^^^ These steps have been learned from tons of headaches around switching projects and navigating build/dependency related errors.
We are on:
firebase_core version: 3.15.0 flutter version: 3.24.2
Curious to know if this is a wider problem and is happening to more people. We are going to try to upgrade firebase_core and/or pigeon and see if that helps. Any insight would be greatly appreciated!
@benjigold my current flutter version:
Flutter 3.34.0-0.0.pre • channel beta
You may want to give it a try!
I have the same issue, but on Android. How did you fix @benjigold ?
Tried upgrading to 3.34.0-0.0.pre but still no luck @thanhdatvo
To mention that in my case it only happens in release mode, in debug it works fine.
Hi all, I’m unable to reproduce this issue on my end. Could you please share a minimal reproducible repository that I can clone to investigate further?
Hi @SelaseKay, Thanks for your willingness to help. Do you have a working sample where we can make changes? I don't have the time to create a simple one from scratch, and the existing samples I find on gitgub are using legacy code that is no longer compatible with the new flutter versions.
Hi @spiderion, you can reference the firebase_core example app.
Hi @SelaseKay, I am on it, I was not yet able to reproduce on the example app but I am looking in the package and I could find the string of the error I am getting in my project
(dev.flutter.pigeon.firebase_core_platform_interface.FirebaseCoreHostApi.initializeCore)
Under the folder windows, I don't know if it's related.
final List<Object?>? pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?; Returns null in my project. So the exception is thrown:
PlatformException _createConnectionError(String channelName) { return PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel: "$channelName".', ); }
@SelaseKay I managed to reproduce. Please apply the patch code in your Android Studio to the example app
when I remove the package ffmpeg_kit_flutter_new: ^3.0.1 the issue disapears
This also fixes the issue
Build runs fine on debug mode. Only occurs in release mode for Android.
Flutter version - 3.24.4
firebase_core: ^4.0.0 firebase_messaging: ^16.0.0 firebase_remote_config: ^6.0.0 firebase_auth: ^6.0.0 ffmpeg_kit_flutter_new: ^3.0.1
This also fixes the issue
Tried this, didn't work for me.
Started working after removing this package
ffmpeg_kit_flutter_new: ^3.0.1
any other workaround? @spiderion
@SelaseKay I managed to reproduce. Please apply the patch code in your Android Studio to the example app
when I remove the package ffmpeg_kit_flutter_new: ^3.0.1 the issue disapears
@sagar-rawat-aisensy they just released a new Firebase. Please try to see if that fixes the issue.
@spiderion already using the latest firebase_core
firebase_core: ^4.0.0
This also fixes the issue