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

iOS app crashes straight after splash screen (iOS 11.2, iPhones X, 8 & 7 on simulator) #618

Closed
sethprogress opened this issue Jan 31, 2018 · 9 comments
Assignees
Milestone

Comments

@sethprogress
Copy link

Create a new {N} + ng + TS, add plugin and initialize firebase as per documentation (and per ng sample) results in iOS app crashing with no errors straight after splash screen. Same as reported here: #611

@EddyVerbruggen
Copy link
Owner

Can you share a repo?

@sethprogress
Copy link
Author

Thanks for the quick reply https://bitbucket.org/nexuschurch/mynexus-app/src

@EddyVerbruggen
Copy link
Owner

Thank you!

There's an issue in 5.1.5 that pops up when the 'realtime db' feature wasn't selected. I'll correct that in 5.1.6 but I'm not entirely sure it will fix your issue as I cloned your repo, did tns run ios, and it loaded the app just fine (bar the error about init in the log that's fixed in 5.1.6) -- it didn't crash.

So before releasing the fix, can you please open node_modules/nativescript-plugin-firebase/firebase.ios.js and replace the resolve` statement on line 600 by this one?

resolve(typeof (FIRDatabase) !== "undefined" ? FIRDatabase.database().reference() : undefined);

Then tns run ios and see if that makes a difference.

@EddyVerbruggen EddyVerbruggen added this to the 5.1.6 milestone Jan 31, 2018
@EddyVerbruggen EddyVerbruggen self-assigned this Jan 31, 2018
EddyVerbruggen added a commit that referenced this issue Jan 31, 2018
@manijak
Copy link

manijak commented Jan 31, 2018

I had the same issue when I installed the plugin today (first time ever). Decided to clean my platform after installation and configuration of the plugin, re-installed iOS platform, and it just worked.

But I do keep seeing this in the console:
CONSOLE LOG file:///app/tns_modules/nativescript-plugin-firebase/firebase.js:603:24: Error in firebase.init: ReferenceError: Can't find variable: FIRDatabase

Replace the line 600 from previous post, exception still present.

@EddyVerbruggen
Copy link
Owner

@manijak If you replace the line as show below, rm -rf platforms/ios, and tns run ios then there shouldn't be an error.

screen shot 2018-01-31 at 18 43 37

@manijak
Copy link

manijak commented Jan 31, 2018

Correct, the error is now gone. thanks.

@sethprogress
Copy link
Author

@manijak - i'm a bit new to NS, what do you mean by this: Decided to clean my platform after installation and configuration of the plugin, re-installed iOS platform?

Is that just deleting the platform folder or is it some commands.

@manijak
Copy link

manijak commented Jan 31, 2018

Yeah running following commands:
tns platform remove ios
tns platform add ios
tns build ios

@sethprogress
Copy link
Author

First I modified the resolve statement, enabled realtime and did rm -rf platforms/ios - Successful!

Thanks for your help guys. I didn't need to remove the platform.

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

3 participants