We recently upgraded from React-native-firebase version 3 to 4.
Crash report:
[__FIRAPP_DEFAULT] firebase app has not been initialized!
2018-04-12 17:04:27.809597-0400 Gameroom[394:273986] The [__FIRAPP_DEFAULT] firebase app has not been initialized!
2018-04-12 17:04:27.812 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: The [__FIRAPP_DEFAULT] firebase app has not been initialized!
2018-04-12 17:04:27.811891-0400 Gameroom[394:273823] Unhandled JS Exception: The [__FIRAPP_DEFAULT] firebase app has not been initialized!
2018-04-12 17:04:27.814 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
2018-04-12 17:04:27.813783-0400 Gameroom[394:273986] Module AppRegistry is not a registered callable module (calling runApplication)
2018-04-12 17:04:27.831928-0400 Gameroom[394:273823] Encountered an uncaught exception. All Mixpanel instances were archived.
2018-04-12 17:04:27.831994-0400 Gameroom[394:273823] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: The [__FIRAPP_DEFAULT] firebase app has not been initialized!', reason: 'Unhandled JS Exception: The [__FIRAPP_DEFAULT] firebase app has not been in..., stack:
value@434:3233
<unknown>@434:3756
init@1489:4789
<unknown>@1590:718
<unknown>@1440:788
d@2:755
<unknown>@431:302
d@2:755
<unknown>@430:111
d@2:755
<unknown>@423:288
d@2:755
<unknown>@346:111
d@2:755
<unknown>@307:201
d@2:755
<unknown>@12:92
d@2:755
n@2:326
global code@1684:8
'
*** First throw call stack:
(0x18283dd04 0x181a8c528 0x10150773c 0x1015051fc 0x182845670 0x1827246cc 0x18272916c 0x10151b188 0x10155f554 0x10155f2b4 0x10418d49c 0x10418d45c 0x10419c110 0x1041909a4 0x10419d104 0x1041a4100 0x182466fd0 0x182466c20)
libc++abi.dylib: terminating with uncaught exception of type NSException
ios
mac
Build Tools:
React Native version:
"react": "^16.3.1",
"react-native": "^0.55.2",
RNFirebase Version:
React Native Firebase 4.0.1
Pods
- Firebase/Analytics (4.12.0):
- Firebase/Core
- Firebase/Auth (4.12.0):
- Firebase/Core
- FirebaseAuth (= 4.6.0)
- Firebase/Core (4.12.0):
- FirebaseAnalytics (= 4.1.0)
- FirebaseCore (= 4.0.19)
- Firebase/Database (4.12.0):
- Firebase/Core
- FirebaseDatabase (= 4.1.5)
- Firebase/Messaging (4.12.0):
- Firebase/Core
- FirebaseMessaging (= 2.2.0)
- Firebase/Performance (4.12.0):
- Firebase/Core
- FirebasePerformance (= 1.1.3)
- Firebase/Storage (4.12.0):
- Firebase/Core
- FirebaseStorage (= 2.2.0)
- FirebaseAnalytics (4.1.0):
- FirebaseCore (~> 4.0)
- FirebaseInstanceID (~> 2.0)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- nanopb (~> 0.3)
- FirebaseAuth (4.6.0):
- FirebaseAnalytics (~> 4.1)
- GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)
- GTMSessionFetcher/Core (~> 1.1)
- FirebaseCore (4.0.19):
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- FirebaseDatabase (4.1.5):
- FirebaseAnalytics (~> 4.1)
- FirebaseCore (~> 4.0)
- leveldb-library (~> 1.18)
- FirebaseInstanceID (2.0.10):
- FirebaseCore (~> 4.0)
- FirebaseMessaging (2.2.0):
- FirebaseAnalytics (~> 4.1)
- FirebaseCore (~> 4.0)
- FirebaseInstanceID (~> 2.0)
- GoogleToolboxForMac/Logger (~> 2.1)
- Protobuf (~> 3.5)
- FirebasePerformance (1.1.3):
- FirebaseAnalytics (~> 4.1)
- FirebaseInstanceID (~> 2.0)
- FirebaseSwizzlingUtilities/ISASwizzling (~> 1.0)
- FirebaseSwizzlingUtilities/MethodSwizzling (~> 1.0)
- GoogleToolboxForMac/Logger (~> 2.1)
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
- GTMSessionFetcher/Core (~> 1.1)
- Protobuf (~> 3.5)
- FirebaseStorage (2.2.0):
- FirebaseAnalytics (~> 4.1)
- FirebaseCore (~> 4.0)
- GTMSessionFetcher/Core (~> 1.1)
- FirebaseSwizzlingUtilities/ISASwizzling (1.0.1)
- FirebaseSwizzlingUtilities/MethodSwizzling (1.0.1):
- FirebaseCore (~> 4.0)
Sounds like you've lost your GoogleServiceInfo.plist file...
@chrisbianca it's definitely there! And removed and re-added it and everything and still getting the error.
It's strange though, it seems to happen once, and then I reload the app and it works fine.
I'm sorry, but this is definitely going to be something to do with your project setup. We've not had any other issues like this flagged since releasing v4. I'd imagine it's your Xcode workspace getting itself in a bit of a pickle.
I'm going to close as it's not going to be a react-native-firebase issue.
@Jonovono
It's strange though, it seems to happen once, and then I reload the app and it works fine.
https://rnfirebase.io/docs/v4.2.x/installation/ios#1.2.-Initialise-Firebase
It is recommended to add the line within the method BEFORE creating the RCTRootView. Otherwise the initialization can occur after already being required in your JavaScript code - leading to app not initialised exceptions.
Error: The [[DEFAULT]] firebase app has not been initialized! i am getting this error only on ios ..any one please help me to resolve this issue.thank you
At the beginning of the didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method add the following line:
[FIRApp configure];
It is recommended to add the line within the method BEFORE creating the RCTRootView. Otherwise the initialization can occur after already being required in your JavaScript code - leading to app not initialised exceptions.
@i1990jain , you save my life
Most helpful comment
@Jonovono
https://rnfirebase.io/docs/v4.2.x/installation/ios#1.2.-Initialise-Firebase