flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

[firebase_core]: Firebase.initializeApp Start application error

Open yys50 opened this issue 1 year ago • 30 comments

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) #1 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:29:41) #2 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:70:7) #3 Firebase.initializeApp (package:firebase_core/src/firebase.dart:66:31)

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 #1 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:29:41) method_channel_firebase.dart:29 #2 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:70:7) method_channel_firebase.dart:70 #3 Firebase.initializeApp (package:firebase_core/src/firebase.dart:66:31) firebase.dart:66

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

yys50 avatar Jul 18 '25 13:07 yys50

Ok then pleaase try this. This worked for me. Make sure you clean your project after doing this.

Image

spiderion avatar Jul 29 '25 10:07 spiderion

@spiderion this worked, thanks.

sagar-rawat-aisensy avatar Jul 29 '25 10:07 sagar-rawat-aisensy

I have the same issue, but on Android. How did you fix @benjigold ?

So all we did was add the carat symbol in our pubspec.yaml file for the firebase_messaging package:

firebase_messaging: ^15.1.3

I'm guessing that a firebase dependency that relates to firebase_messaging updated after we cleaned flutter and ran flutter pub get. We did not have the carat symbol for that package, so I'm guessing that a new firebase package was updated and was no longer compatible to firebase_messaging 15.1.3 which our project was forcing that version. My pubspec.lock file shows that the version resolved to 15.2.10 which supports our theory.

I'm glad that we got it to work but if we are correct about this analysis, it indicates theres a compatibility bug between firebase_messaging 15.1.3 and something else

benjigold avatar Jul 29 '25 15:07 benjigold

me too

zeqinjie avatar Aug 01 '25 03:08 zeqinjie

I hope my case will be helpful.

I had a similar error, I turned off the emulator completely and then restarted and saw the debug console.

In my case, the following error existed in the debug console.

Error: The plugin "cloud_firestore" requires a higher minimum iOS deployment version than your application is targeting.
To build, increase your application's deployment target to at least 15.0 as described at https://flutter.dev/to/ios-deploy
Error running pod install
Error launching application on iPhone 16 Pro.

Among the above, deployment target to at least 15.0 was applied to the ios/Podfile.

platform :ios, '15.0'

After this setting, I ran the emulator again, and the error was fixed.

For your information, it took 6 minutes for the app to run after that setting, so if you use this method, I recommend you wait slowly.

WinningBean avatar Aug 07 '25 12:08 WinningBean

To mention that in my case it only happens in release mode, in debug it works fine.

same problem face

Dishant624 avatar Aug 14 '25 09:08 Dishant624

com.android.billingclient:billing version effecting this. 8.0.0 not working while 7.0.0 works.

code-flutter-dev avatar Aug 25 '25 16:08 code-flutter-dev

Hey @yys50. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Sep 02 '25 18:09 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@yys50 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Sep 10 '25 18:09 google-oss-bot

Started working after removing this package

ffmpeg_kit_flutter_new: ^3.0.1

any other workaround? @spiderion

Issue_firebase.patch @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

Follow this one try to add progaurd-rules.pro too. ffmpegkit new issue 76

flutter clean
flutter pub get

ani-backend avatar Sep 20 '25 12:09 ani-backend