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

Android. android.context not available before application.start() is called. #156

Closed
kritollm opened this issue Oct 7, 2016 · 4 comments
Milestone

Comments

@kritollm
Copy link

kritollm commented Oct 7, 2016

I was calling fireBase.init() before the application.start() in app.js.

It worked in IOS, but on Android (real device and emulator) it didn't work. The log traced the error to firebase.android.js line 185 com.facebook.FacebookSdk.sdkInitialize(appModule.android.context);. appModule.android.context was undefined/null.

I changed the code to run fireBase.init() after application.start() and it worked.

Is this a Nativescript bug, nativescript-plugin-firebase bug or just expected behaviour?

@EddyVerbruggen
Copy link
Owner

That's a bug in the plugin - let me try to reproduce that..

@EddyVerbruggen
Copy link
Owner

Can you test whether the current version on GitHub fixes the problem for you?

I'm not entirely comfortable with calling init before app start (you need to require the plugin before app start, not init), but I'd like to make it work also for your scenario nonetheless.

@kritollm
Copy link
Author

kritollm commented Oct 7, 2016

Yes, it worked.

@EddyVerbruggen
Copy link
Owner

Sweet! Available in 3.6.4.

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

No branches or pull requests

2 participants