Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

FirebaseApp with name [DEFAULT] doesn't exist #99

Closed
jahidshohel opened this issue Aug 4, 2016 · 7 comments
Closed

FirebaseApp with name [DEFAULT] doesn't exist #99

jahidshohel opened this issue Aug 4, 2016 · 7 comments

Comments

@jahidshohel
Copy link

I am using tns version 2.1.1. And running my app on my Android device. Followed the instructions given here known-issues-on-android, but still getting error FirebaseApp with name [DEFAULT] doesn't exist.

JS: Error in firebase.init: Error: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
JS: com.google.firebase.FirebaseApp.getInstance(Unknown Source)
JS: com.google.firebase.FirebaseApp.getInstance(Unknown Source)
JS: com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
JS: com.tns.Runtime.runModule(Native Method)
JS: com.tns.Runtime.runModule(Runtime.java:241)
JS: com.tns.Runtime.run(Runtime.java:235)
JS: com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
JS: android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
JS: android.app.ActivityThread.handleBindApplication(ActivityThread.java:6321)
JS: android.app.ActivityThread.access$1800(ActivityThread.java:222)
JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1861)
JS: android.os.Handler.dispatchMessage(Handler.java:102)
JS: android.os.Looper.loop(Looper.java:158)
JS: android.app.ActivityThread.main(ActivityThread.java:7229)
JS: java.lang.reflect.Method.invoke(Native Method)
JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
JS: Firebase init errorError: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
JS: com.google.firebase.FirebaseApp.getInstance(Unknown Source)
JS: com.google.firebase.FirebaseApp.getInstance(Unknown Source)
JS: com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
JS: com.tns.Runtime.runModule(Native Method)
JS: com.tns.Runtime.runModule(Runtime.java:241)
JS: com.tns.Runtime.run(Runtime.java:235)
JS: com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
JS: android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
JS: android.app.ActivityThread.handleBindApplication(ActivityThread.java:6321)
JS: android.app.ActivityThread.access$1800(ActivityThread.java:222)
JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1861)
JS: android.os.Handler.dispatchMessage(Handler.java:102)
JS: android.os.Looper.loop(Looper.java:158)
JS: android.app.ActivityThread.main(ActivityThread.java:7229)
JS: java.lang.reflect.Method.invoke(Native Method)
JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

@el-davo
Copy link

el-davo commented Aug 7, 2016

+1 Getting same issue

@EddyVerbruggen
Copy link
Owner

I can reproduce it by removing the 2 lines from build.gradle. Readding those solves it.

So added classpath "com.google.gms:google-services:3.0.0" near the top and apply plugin: "com.google.gms.google-services" at the very bottom of that file in platforms/android.

@shripalsoni04
Copy link
Contributor

I also got the same issue in my angular nativescript app when I have written firebase.init before app bootstrap.

I don't know the exact reason why, but it got resolved once I moved the firebase.init call to after bootstrap in root component. After doing that, firebase functionalities are working properly.

May be this will help you.

@EddyVerbruggen
Copy link
Owner

@shripalsoni04 Ah, good call. I will try and reproduce it that way and if it's unfixable I'll add it to the README. 👍

@EddyVerbruggen
Copy link
Owner

Fixed: you can now (version 3.5.0) safely call init before the app starts on Android (already worked fine on iOS).

@madhurvms
Copy link

how to resolve in spring Boot?

@xBentu
Copy link

xBentu commented Dec 17, 2019

how to resolve in spring Boot?

I second this, would love to know how we can resolve this issue in a spring boot app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants