The code works on Android emulator (shown below), but not the iOS simulator, the console says segmentation fault: 11. Is this a bug with the simulator?
Android Emu works fine:

On iOS simulator:

Which line makes it crash, and what happens on a real device?
Hello Eddy,
Line 25, firebase.login(...) is the cause to this problem. I don't have a real iOS device to test on, so I can't really confirm what happens when it runs on a real device.
On line 25 there's loginType. What's the runtime value?
The loginType value is either LoginType.FACEBOOK, LoginType.GOOGLE, it depends on user's selection. Both failed anyway.
Just to be sure, LoginType.FACEBOOK evaluates correctly for a string?
As far as I can tell LoginType.FACEBOOK is one of enum element I imported from nativescript-plugin-firebase. I didn't quite get what you mean though, please tell me if I misunderstood.
I was wondering if that enum would evaluate to its string representative at runtime. So what's the output of this (place it right before your call to login())?
console.log("runtime value of LoginType.FACEBOOK: " + LoginType.FACEBOOK);
For FACEBOOK it's facebook and for GOOGLE it's google.

Thanks, that looks fine.
Have you ever looked at iOS crash logs before? It's quite awful unfortunately... but can you please open Xcode, select Window > Devices, select the device, and watch the console output while the app crashes? Perhaps there's more useful info in there, because "Segmentation fault: 11" is the generic "I crashed for some reason" message..
Here is the log I got from the simulator:
error 01:42:26.204583 +0700 SpringBoard HW kbd: Failed to set (null) as keyboard focus error 01:42:26.207984 +0700 backboardd Unable to get short BSD proc info for 766: No such process error 01:42:26.208767 +0700 backboardd Unable to get proc info for 766: Undefined error: 0 default 01:42:26.777917 +0700 SpringBoard < FBApplicationProcess: 0x7f86f3533570; FirebaseAuth; pid: 766 > crashed. default 01:42:26.778769 +0700 SpringBoard Process exited: < FBApplicationProcess: 0x7f86f3533570; FirebaseAuth; pid: -1 > -> < FBApplicationProcessExitContext: 0x600000630520; exitReason: crash; terminationReason: (none) >
I see similar crash logs all over the web for various reasons. It's such a pity this isn't very explicit as well.
Have you tried it on a device as well? Btw, which simulator version is this?
That's right, even another platform suffers from this issue though some can be solved by recompile the code and redeploy the application in the simulator, but that doesn't seem to work here. I haven't tested on a real device yet (I don't have one that I can access ATM)
I have Xcode, whose version = 8.3 and Simulator version = 10.0.
I recently started the iOS work on my app and I managed to login once with Facebook, then I keep getting the same Segmentation fault error. It works perfectly on Android.
The issue seem to be fixed if I wipe the emulator, however after one successful login, the application must remain unchanged otherwise it will fail with segmentation fault 11.
Hi
I am also getting a crash on running the app. Am using the latest version of the plugin - 3.11.3.
The message in the console is FBSDKAccessToken.currentAccessToken().tokenString')
file:///app/tns_modules/nativescript-plugin-firebase/firebase.js:859:103: JS ERROR TypeError: null is not an object (evaluating 'FBSDKAccessToken.currentAccessToken().tokenString').
For now I have moved back to version 3.11.2 and the app seems to work fine.
Is this related to Return Facebook access token to login result for use with FB SDK
I am having the same issue (app works fine on Android but not on iOS Simulator). In the iOS Simulator, it crashes the app, showing the following in the console:
May 2 15:18:39 Alexs-MBP-2 com.apple.CoreSimulator.SimDevice.B7D573A3-A225-4E48-9E63-AC98B7CB8F29.launchd_sim[15043] (UIKitApplication:com.asouza.buddyFinder[0x90c7][15065][15135]): Service exited due to Segmentation fault: 11
Checking the Console in Xcode, I got this info:
May 2 15:32:22 Alexs-MBP-2 SpringBoard[15060]: [KeyboardArbiter] HW kbd: Failed to set (null) as keyboard focus
May 2 15:32:22 Alexs-MBP-2 com.apple.CoreSimulator.SimDevice.B7D573A3-A225-4E48-9E63-AC98B7CB8F29.launchd_sim[15043] (UIKitApplication:com.asouza.buddyFinder[0xa85d][15065][15381]): Service exited due to Segmentation fault: 11
May 2 15:32:22 Alexs-MBP-2 backboardd[15061]: [Common] Unable to get short BSD proc info for 15381: No such process
May 2 15:32:22 Alexs-MBP-2 backboardd[15061]: [Common] Unable to get proc info for 15381: Undefined error: 0
May 2 15:32:23 Alexs-MBP-2 assertiond[15065]: Deleted job with label: UIKitApplication:com.asouza.buddyFinder[0xa85d][15065]
Any ideas?
Same issue here. On login, Android works fine, ios Segmentation fault: 11
I solved my troubles by copying the Info.plist of the plugin sample app. There are additions compared to what's in the instructions in the plugin docs and in Facebook's docs.
Not sure I understood rossbg (sorry). What did you exactly do?
Hi,
I have the same issue... is there a way to fix it?
Jun 5 20:49:04 iMac-di-pdoorr com.apple.CoreSimulator.SimDevice.297BD67A-6483-43BB-B887-0FE21E773E8C.launchd_sim[596] (UIKitApplication:it.decanter[0x28f2][651
][22235]): Service exited due to Segmentation fault: 11
I have the latest version of the plugin and the iOS issue above also stills :(
I don't know yet (I am new to the development world) how to test the app on my iPhone so, I cannot say if it will work on the device or not.
Any ideas on how to fix this?
I have tried with 3 different emulated iPhone versions 10.3, 9.3, 8.4with no luck, always the same error... I have no physical device to verify if it's a real problem or not...
The way I fixed it was using the sample app Info.plist, as mentioned by rossbg above.
@d3mac123 Can you please elaborate what were the changes?
@derFaizio just go to the Code tab (on this page, above), then click the clone our demo app link (under the Usage section). It will open the demo contents. Drill down to the folders
/Firebase/app/App_Resources/iOS/Info.plist
Copy and paste the Info.plist contents over your current Info.plist file. Replace the demo Facebook ID and app name with yours and don't change anything else. These are the lines:
<array>
<string>fb126035687816994</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>126035687816994</string>
<key>FacebookDisplayName</key>
<string>N Firebase plugin demo</string>
<key>LSApplicationQueriesSchemes</key>
adding this to the info.plist did it for me
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
For me I saw the crash on google based login.. so all the above post helped me solve it.
Even though I do not use facebook login. In the ios crash I saw
Process exited: <FBApplicationProcess: 0x7fd5ffe4ac20; firelogin (org.nativescript.hw); pid: -1> -> <FBApplicationProcessExitContext: 0x60c000247770; exitReason: crash; terminationReason: (none)> {
聽 聽 stateAtExit = <FBProcessState: 0x60c00022b480; pid: 22231; taskState: Not Running; visibility: Unknown>;
}
I added everything from demo info.plist and slowly removed key by key to identify the issue. Finally the below is what needed in info.plist to make it work.
<!-- added from demo app to work in emulator -->
<!-- com.googleusercontent..... is from my googleServices-info.plist -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>REVERSED_CLIENT_ID</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.2312.FROM YOUR googleServices-info.plist.........</string>
</array>
</dict>
</array>
@narayananl23 Just FYI because you mentioned Facebook: those FBApplicationProcess and FBApplicationProcess are not Facebook classes; those are from a private iOS framework called FrontBoard.
Yikes this was really unclear to me. Thx all. Created https://github.com/EddyVerbruggen/nativescript-plugin-firebase/pull/1244 to increase clarity.