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 #36

Closed
mnesarco opened this issue May 28, 2016 · 9 comments
Closed

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

mnesarco opened this issue May 28, 2016 · 9 comments

Comments

@mnesarco
Copy link

Hi Guys,

I have been trying to make this plugin to work in my project, but I am stuck with this error:

V/JS      (32145): firebase.init error: Error: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist. 
V/JS      (32145):     com.google.firebase.FirebaseApp.getInstance(Unknown Source)
V/JS      (32145):     com.google.firebase.FirebaseApp.getInstance(Unknown Source)
V/JS      (32145):     com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
V/JS      (32145):     com.tns.Runtime.callJSMethodNative(Native Method)
V/JS      (32145):     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
V/JS      (32145):     com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
V/JS      (32145):     com.tns.Runtime.callJSMethod(Runtime.java:712)
V/JS      (32145):     com.tns.Runtime.callJSMethod(Runtime.java:693)
V/JS      (32145):     com.tns.Runtime.callJSMethod(Runtime.java:683)
V/JS      (32145):     com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
V/JS      (32145):     android.app.Activity.performCreate(Activity.java:6021)
V/JS      (32145):     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
V/JS      (32145):     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
V/JS      (32145):     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
V/JS      (32145):     android.app.ActivityThread.access$800(ActivityThread.java:155)
V/JS      (32145):     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)
V/JS      (32145):     android.os.Handler.dispatchMessage(Handler.java:102)
V/JS      (32145):     android.os.Looper.loop(Looper.java:135)
V/JS      (32145):     android.app.ActivityThread.main(ActivityThread.java:5376)
V/JS      (32145):     java.lang.reflect.Method.invoke(Native Method)
V/JS      (32145):     java.lang.reflect.Method.invoke(Method.java:372)
V/JS      (32145):     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
V/JS      (32145):     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

@EddyVerbruggen
Copy link
Owner

I may have forgotten to add something to the readme. Can you please try this to see if that fixes your problem?

  • Open platforms/android/build.gradle
  • Near the top there's a dependencies section, add classpath "com.google.gms:google-services:3.0.0" so it becomes something like:
    dependencies {
        classpath "com.android.tools.build:gradle:1.5.0"
        classpath "com.google.gms:google-services:3.0.0"
    }
  • Add the very bottom of the same file add apply plugin: "com.google.gms.google-services"

@mnesarco
Copy link
Author

Thanks Eddy,

It works now. One question: Is there a way to made this changes permanent? I mean to survive when we remove and then add android platform....

@EddyVerbruggen
Copy link
Owner

Thanks for the quick check!

I don't think it will persist indeed.

I'll keep this open as a reminder to figure out how to do this via the plugin (if at all possible), but for now I'll add it to the readme.

EddyVerbruggen added a commit that referenced this issue May 29, 2016
FirebaseApp with name [DEFAULT] doesn't exist #36
@mnesarco
Copy link
Author

mnesarco commented Jun 2, 2016

Hi Eddy,

It worked initially, but after google sdk update, I got this error:

Found com.google.android.gms:play-services-gcm:8.4.0, but version 9.0.0 is needed for the google-services plugin.

I have googled all the day, it is supposed that I have to add

compile 'com.google.android.gms:play-services:9.0.0'

to the dependencies in the app level build.gradle, but in nativescritp there is no "app level" build.gradle.
I have tried in app/App_Resources/android/app.gradle with no success.

EDIT:
I deleted node_modules and platforms directories and now everything is work.... oh no. Now I have reached the 65k dex limit :(

@EddyVerbruggen
Copy link
Owner

Added a bunch of these (and other) issues to the readme (scroll down).

@IvRRimum
Copy link

IvRRimum commented Jul 20, 2016

I did all of the above, the problem is still present...

I followed your tutorial video.

@gabrielpiassetta
Copy link

Same here, did everything exactly as documented in README, more than one time.

Started a project from scratch and tried again, problem stills present.

For days I'm looking for a solution.

@IvRRimum
Copy link

@gabrielpiassetta I just continued the app development. The error doesn't affect the app in any way( from wha i have seen ). So just carry on. It will be fixed eventually.

@jvzanatta
Copy link

Same here (done everything from readme, error still bugs me but doesn't affect the app...

EddyVerbruggen added a commit that referenced this issue Apr 18, 2017
FirebaseApp with name [DEFAULT] doesn't exist #36
rosen-vladimirov pushed a commit to rosen-vladimirov/nativescript-plugin-firebase that referenced this issue Apr 21, 2017
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

5 participants