Code Monkey home page Code Monkey logo

Comments (7)

TarekkMA avatar TarekkMA commented on July 22, 2024 1

Hello @qwadrox,

Thank you for your report. Based on the comment here, it seems this issue stems from the underlying native plugin, and we might not be able to address it directly. Could you confirm if you have any issues related to or caused by this?

from flutterfire.

tarunkhatri avatar tarunkhatri commented on July 22, 2024

Hi @qwadrox
i am facing same issue my flutter version is 3.22.0 and firebase_core version is 3.0.0
Your workaround is not working for me.
Can someone please help, trying to figure it out from 2-3 days

the error i am getting is-

flutter: PlatformException(channel-error, Unable to establish connection on channel., null, null)
flutter: #0 FirebaseCoreHostApi.initializeCore (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:210:7)

#1 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:29:44)

#2 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:73:7)

#3 Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:31)

#4 initialChecks (package:creatics_mobile/main.dart:108:3)

#5 main. (package:creatics_mobile/main.dart:75:11)

#6 main (package:creatics_mobile/main.dart:73:3)

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
#0 MethodChannelFirebase.app (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:193:5)
#1 Firebase.app (package:firebase_core/src/firebase.dart:56:41)
#2 FirebaseCrashlytics.instance (package:firebase_crashlytics/src/firebase_crashlytics.dart:33:55)
#3 main. (package:creatics_mobile/main.dart:81:27)
#4 _RootZone.runBinary (dart:async/zone.dart:1666:54)
#5 runZonedGuarded. (dart:async/zone.dart:1798:18)
#6 _Zone._processUncaughtError (dart:async/zone.dart:1081:14)
#7 _CustomZone.handleUncaughtError (dart:async/zone.dart:1285:5)

from flutterfire.

qwadrox avatar qwadrox commented on July 22, 2024

Hi @qwadrox
i am facing same issue my flutter version is 3.22.0 and firebase_core version is 3.0.0
Your workaround is not working for me.
Can someone please help, trying to figure it out from 2-3 days

the error i am getting is-

flutter: PlatformException(channel-error, Unable to establish connection on channel., null, null)
flutter: #0 FirebaseCoreHostApi.initializeCore (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:210:7)

#1 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:29:44)

#2 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:73:7)

#3 Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:31)

#4 initialChecks (package:creatics_mobile/main.dart:108:3)

#5 main. (package:creatics_mobile/main.dart:75:11)

#6 main (package:creatics_mobile/main.dart:73:3)

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
#0 MethodChannelFirebase.app (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:193:5)
#1 Firebase.app (package:firebase_core/src/firebase.dart:56:41)
#2 FirebaseCrashlytics.instance (package:firebase_crashlytics/src/firebase_crashlytics.dart:33:55)
#3 main. (package:creatics_mobile/main.dart:81:27)
#4 _RootZone.runBinary (dart:async/zone.dart:1666:54)
#5 runZonedGuarded. (dart:async/zone.dart:1798:18)
#6 _Zone._processUncaughtError (dart:async/zone.dart:1081:14)
#7 _CustomZone.handleUncaughtError (dart:async/zone.dart:1285:5)

Your issue is completely different than mine. I didn't have platform exception.

But this might help:
https://stackoverflow.com/questions/72880037/unhandled-exception-platformexceptionchannel-error-unable-to-establish-connec
https://stackoverflow.com/questions/72833245/calling-firebase-initializeapp-returns-unable-to-establish-connection-on-chan

from flutterfire.

qwadrox avatar qwadrox commented on July 22, 2024

Hello @qwadrox,

Thank you for your report. Based on the comment here, it seems this issue stems from the underlying native plugin, and we might not be able to address it directly. Could you confirm if you have any issues related to or caused by this?

@TarekkMA
I understand, but I think the documentation should be updated regarding this side effect since the official way to configure Firebase is through the FlutterFire CLI.

Another improvement would be to print a message indicating successful initialization when it happens from the Dart code.

from flutterfire.

russellwheatley avatar russellwheatley commented on July 22, 2024

@qwadrox - If you manually add the GoogleService-Info.plist to the Runner, you still don't need to manually update your AppDelegate.
This is enough:

 await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );

this is probably why you're seeing that log in your console.

from flutterfire.

qwadrox avatar qwadrox commented on July 22, 2024

@qwadrox - If you manually add the GoogleService-Info.plist to the Runner, you still don't need to manually update your AppDelegate. This is enough:

 await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );

this is probably why you're seeing that log in your console.

@russellwheatley
"If you manually add the GoogleService-Info.plist to the Runner" I've added it, but i have to still edit AppDelegate. I use a build script for that in my app.
In the repro sample I did add as well: https://github.com/qwadrox/my_catalog_app/blob/bug/firebase-core-not-being-initialized/ios/Runner/GoogleService-Info.plist

from flutterfire.

russellwheatley avatar russellwheatley commented on July 22, 2024

Sorry, I just realised what you were referring to. We check allApps here: https://github.com/firebase/flutterfire/blob/master/packages/firebase_core/firebase_core/ios/Classes/FLTFirebaseCorePlugin.m#L46

Which outputs this log:https://github.com/firebase/firebase-ios-sdk/blob/f3ce673e624e67f39dd5462731a70277d0290595/FirebaseCore/Sources/FIRApp.m#L264

which is not an error, it is a warning that can be safely ignored. We literally configure the app in the next line: https://github.com/firebase/flutterfire/blob/master/packages/firebase_core/firebase_core/ios/Classes/FLTFirebaseCorePlugin.m#L47

from flutterfire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.