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)
+1 Getting same issue
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.
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.
@shripalsoni04 Ah, good call. I will try and reproduce it that way and if it's unfixable I'll add it to the README. 馃憤
Fixed: you can now (version 3.5.0) safely call init before the app starts on Android (already worked fine on iOS).
how to resolve in spring Boot?
how to resolve in spring Boot?
I second this, would love to know how we can resolve this issue in a spring boot app.
Most helpful comment
I second this, would love to know how we can resolve this issue in a spring boot app.