React-native-firebase: [FIRApp configure] crashes app on ios simulator

Created on 6 Oct 2017  路  7Comments  路  Source: invertase/react-native-firebase

Running my RN app with react-native run-ios is working until integrating firebase on ios/AppDelegate.m file. After adding, the app crashes after showing (> 1 sec)

(did pod update and/or pod install after manually removing Pods folder)

See this this recording: http://recordit.co/Ry74pTUpmC

I'm using iPhone 6 (iOS 11.0) simulator

This is the system log

Oct  6 16:14:54 Michael-MBP com.apple.CoreSimulator.SimDevice.D1B5DE36-2EA8-4AB5-A760-73F98649F1B3[19245] (com.apple.videosubscriptionsd[20973]): Service exited with abnormal code: 1
Oct  6 16:14:55 Michael-MBP com.apple.CoreSimulator.SimDevice.D1B5DE36-2EA8-4AB5-A760-73F98649F1B3[19245] (com.apple.videosubscriptionsd): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Oct  6 16:14:56 Michael-MBP RNFirebase3[20976]: assertion failed: 17A365 15A372: libxpc.dylib + 69578 [D870A237-D3A7-31F5-AAD4-CE880C0C8E7B]: 0x7d
Oct  6 16:15:05 Michael-MBP com.apple.CoreSimulator.SimDevice.D1B5DE36-2EA8-4AB5-A760-73F98649F1B3[19245] (com.apple.videosubscriptionsd[20977]): Service exited with abnormal code: 1

Steps to reproduce:

see commit on my sample app https://github.com/mjmaix/RNFirebase3/commit/4040fffc504f3fb002d76f146c717598b267dcba and https://github.com/mjmaix/RNFirebase3/commit/a95959c7cee519319ac82bdbb2951592dd1ef7cb

Some Investigations

I originally raised the issue on https://github.com/firebase/firebase-ios-sdk/issues/340
But after some experimenting by creating xcode project, pod install, import firebase/core which are working (not crashing). So it seems that the issue is on react-native side.

I would like to ask for some help regarding this issue. Also let me know how I can help. I'm not an iOS dev so I can't investigate more on that side.

Environment

  1. Application Target Platform:
    9

  2. Development Operating System:
    macOS High Sierra

  3. Build Tools:
    Version 9.0 (9A235)

  4. Deps versions:
    "dependencies": {
    "react": "16.0.0-alpha.12",
    "react-native": "0.48.4",
    "react-native-firebase": "^3.0.0"
    }

Others

GoogleService-Info.plist exists on local repo but ignored on commit

gem which cocoapods
/Users/mick/.rvm/gems/ruby-2.4.0@global/gems/cocoapods-1.3.1/lib/cocoapods.rb
npm --version
5.4.2

Please update the demo/example

At the very least I'll ask for the demo/example with v3, to be updated so that I can copy a working version as a boilerplate.

Most helpful comment

Fixed it, I opened the project on xcode using .xcworkspace, run the app
By doing this, the logs would remain even after the app crashed.

*** Terminating app due to uncaught exception 'com.firebase.core', reason: '`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.'

Missing GoogleService-Info.plist
Apparently, I have to use Xcode's Add files to project instead of copy pasting it on the folder.

similar to:
https://github.com/invertase/react-native-firebase/issues/247#issuecomment-315131432

Maybe we should update the docs to make it clear

All 7 comments

@mjmaix are you able to get CRNA to work with npm 5? I had to downgrade to npm 4.

Fixed it, I opened the project on xcode using .xcworkspace, run the app
By doing this, the logs would remain even after the app crashed.

*** Terminating app due to uncaught exception 'com.firebase.core', reason: '`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.'

Missing GoogleService-Info.plist
Apparently, I have to use Xcode's Add files to project instead of copy pasting it on the folder.

similar to:
https://github.com/invertase/react-native-firebase/issues/247#issuecomment-315131432

Maybe we should update the docs to make it clear

@iosdev-republicofapps I'm not using CRNA for that project. I only created via react-native init

@mjmaix That solved my problem! THANK YOU!

@mjmaix Made my day ! Luv you bro

Open Xcode and open AppDelagate.m
import this
#import
add in starting of didFinishLaunchingWithOptions [FIRApp configure];

for example

import

@implementation AppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    [FIRApp configure];
    //rest codes
    }

Open Xcode and open AppDelagate.m
import this
#import
add in starting of didFinishLaunchingWithOptions [FIRApp configure];

for example

import

@implementation AppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    [FIRApp configure];
    //rest codes
    }
Was this page helpful?
0 / 5 - 0 ratings