-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default FirebaseApp is not initialized #816
Comments
+1 |
On iOS I was getting the error "Firebase isn't initialised" when calling the getToken method. |
+1 I have the same problem |
|
Get "Firebase isn't initialised" on Android after the DeviceReady,too |
+1 Same issue, Was working 2 weeks ago, Just installed it and now android won't compile. iOS is fine though |
In an GDPR approch you have to let users choose if they want or not to upload data to Firebase services. So Firebase haven't to be initialized by default. Look at the code and use following methods to initialize services before using them : For my own I still using my fork which is working fine. I didn't have time to check if all merged PR are working. |
Adding window.FirebasePlugin.initFirebase(); before getToken worked for me. |
@CWollinger thanks! adding window.FirebasePlugin.initFirebase() worked for me too. i am using version 1.1.2 |
Calling Reviewing the plugin, version 1.0.5 I found this, : Edit, |
Thanks for the fix @CWollinger |
Looks like issue is related to this https://stackoverflow.com/questions/37321728/firebaseinitprovider-firebaseapp-initialization-unsuccessful we need google services on gradle.build file |
Got the "Firebase isn't initialised" on Android. I have two computers, and one Ionic project : When i npm install > add android platform on the first one, then build : no problem, getToken() gives me the token. But on the second one i keep having the error even after 1/ doing the same exact steps, 2/ messing with MainActivity.java / push in build.gradle or manually adding dependencies. @8tomo8 when you say : |
@8tomo8 I have the same question. I added |
@BrainOverflown @rubytann I am using iOS so Android would look slightly different, but here is my getToken() function that is working 100% on emulator and device. The code is in a provider that is called on the ionViewDidEnter() lifestyle hook on the root page.
|
@8tomo8 Doesn't work for me, i got this error :
|
@BrainOverflown this isn't a suggested solution, but rather just isolating the problem. Can you put the getToken inside a timeout of 3 seconds from the ionViewDidEnter() and see if it makes a difference? I have had this before.
|
Did not change anything. "Firebase isn't initialised" still. The problem is that i can build with "Firebase working well" on one computer, but not the second one. Here is my code : home.ts
Which call on this provider : firebase-poc.ts
|
Created pull request to fix google services issue, which causes app crash, after this with latest changes we need to do |
@Drintios So basically, what you're advising is to update cordova-plugin-firebase to it's latest version which support the initFirebase method ? |
yep, with my PR it shouldn't crash anymore |
#816 Fix for google services issue (Firebase not initialized)
fix has been published via v1.1.3 |
You should reopen it, i still have the problem |
@BrainOverflown would you suggest also reverting the PR? |
No, since my problem is not related to the fix made by @Drintios . Just let more people to test the commit and we'll see. Thank you |
I am currently running into this issue now, this is happening on an iOS device. Have not tested this on an Android device. |
App crashing/not starting ? or issue with init firebase in js console ? |
Just with the init firebase part. I tried using the |
i see, i think we need to open need thread for this issue as it not related to app crash. |
I already did @Drintios |
great :) |
Thanks @BrainOverflown , I'll follow your thread! |
Closing per the community discussion |
On ionic v3 i created a provider for Analytics.. Works for me! `import { Injectable } from '@angular/core'; @Injectable()
}` |
I managed to make it working (the 1.1.3 version) by calling these methods in my app.components.ts, just after the device is ready
You also need to declare Firebase Plugin to use it
|
This is being fixed via #830. Hopefully the community can help get the PR tested soon so I can release the fix. |
Unfortunately this is still exist on android I need to support this legacy code and include firebase, all good on iOS just on Android it's always the same error. I checked the source code and indeed the firebase init code was there. Any lead is highly appreciated.
|
After updating to plugin version 1.1.0, app crashes immediately at launch on Android devices.
Log excerpt:
I realize this may be a duplicate of #142, #715 or #206 but those are closed and meant to be fixed.
We have been using the plugin for quite a while and never actually encountered this before. It's only occurring in plugin version 1.1.0 for us. We have downgraded to version 1.0.5 again and now everything works again. So, I thought I'd open a new issue for this as there may be some regression error. Happy to provide more info if there are questions...
The text was updated successfully, but these errors were encountered: