react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

App crash on startup - (libc++abi.dylib: terminating with uncaught exception)

Open creative-git opened this issue 9 years ago • 33 comments

After installing the package, the app crash on startup xcode shows the following error:

screen shot 2017-08-05 at 2 03 05 pm

libc++abi.dylib: terminating with uncaught exception of type NSException

my pod file is ass follows:

# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'

target 'AppName' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for AppName

  target 'AppNameTests' do
    inherit! :search_paths
    # Pods for testing
  end

  pod 'Firebase/Core'
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
  pod 'Firebase/AdMob'
  pod 'Firebase/Analytics'
  pod 'Firebase/Auth'
  pod 'Firebase/Crash'
  pod 'Firebase/Database'
  pod 'Firebase/DynamicLinks'
  pod 'Firebase/Messaging'
  pod 'Firebase/RemoteConfig'
  pod 'Firebase/Storage'
  pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    #'BatchedBridge', # Required For React Native 0.45.0+
    'Core',
    # Add any other subspecs you want to use in your project
  ]
end

Environment

  1. iOS
  2. macOS Sierra
  3. Xcode
  4. React Native version: 0.44):
  5. same issue in RNFirebase Version : 2.0.5 & 2.1.0

creative-git avatar Aug 05 '17 10:08 creative-git

got it working, https://github.com/invertase/react-native-firebase/issues/247

looks like iOS pasting the file into the directory doesn't automatically add the file to the iOS project. You need to manually add it (which I only know how to do within XCode) by:

  • Right click on your project
  • Click "Add files to 'project name'"
  • Select the .plist file
  • Click ok

creative-git avatar Aug 05 '17 10:08 creative-git

What plist file did your import @barjas?

simplenotezy avatar Oct 26 '17 08:10 simplenotezy

@simplenotezy Probably the GoogleService-Info.plist

camel113 avatar Oct 26 '17 15:10 camel113

I am getting the same error, did you solve it?

jsgovea avatar Dec 24 '17 19:12 jsgovea

where could i fined GoogleService-Info.plist

abuammar avatar Jan 23 '18 14:01 abuammar

@simplenotezy where can i find GoogleService-Info.plist file. this is the error i am getting when try to run the app on device

2018-01-24 17:24:26.585 WS1.com[285:334004] *** Assertion failure in -RCTBatchedBridge loadSource:, /Users/ws1/Code/mobile/node_modules/react-native/React/Base/RCTBatchedBridge.m:192 2018-01-24 17:24:26.592 WS1.com[285:334004] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'bundleURL must be non-nil when not implementing loadSourceForBridge' *** First throw call stack: (0x2531391b 0x24aaee17 0x253137f1 0x25af7583 0x161a85 0x16057f 0x1602e1 0x194ccd 0x194bc9 0x193fa1 0x193e11 0x1112d5 0xc8663 0x29903785 0x29b2b2d1 0x29b2f285 0x29b4383d 0x29b2c7b3 0x269b6c07 0x269b6ab9 0x269b6db9 0x252d5dff 0x252d59ed 0x252d3d5b 0x25223229 0x25223015 0x298fcc3d 0x298f7189 0xc8bc7 0x24ecb873) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

abuammar avatar Jan 24 '18 14:01 abuammar

@abuammar /ios/your-app/GoogleService-Info.plist

camel113 avatar Jan 27 '18 12:01 camel113

have u guys found a solution to this problem ?

gomezfe avatar Apr 19 '18 21:04 gomezfe

@gomezfe yes you need to add the file with xcode so it correctly links the file.

Ehesp avatar Apr 30 '18 15:04 Ehesp

I'm getting this error. I've confirmed that GoogleServices-Info.plist is added to the project (visible under "Link Binary with Libraries"). This is all xcode is telling me:

libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Here's my podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'AppName' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for AppName
  pod 'Fabric'
  pod 'Crashlytics'
  # Add new pods below this line
  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'Firebase'
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

  pod 'React', :path => '../node_modules/react-native', :subspecs =>
  [
    'Core',
    'RCTNetwork',
    'DevSupport'
  ]
  pod 'RNBackgroundGeolocation', :path => '../node_modules/react-native-background-geolocation-android'
  pod 'RNBackgroundFetch', :path => '../node_modules/react-native-background-fetch'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  target 'AppNameTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

And AppDelegate.m:

#import "AppDelegate.h"
#import <Firebase.h>
#import "RNFirebaseNotifications.h"
#import "RNFirebaseMessaging.h"

#import <Fabric/Fabric.h>
#import <Crashlytics/Crashlytics.h>

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];
  [RNFirebaseNotifications configure];

  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"AppName"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];

  [Fabric with:@[[Crashlytics class]]];

  return YES;
}

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  [[RNFirebaseNotifications instance] didReceiveLocalNotification:notification];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
                                                       fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
  [[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
  [[RNFirebaseMessaging instance] didRegisterUserNotificationSettings:notificationSettings];
}

@end

jmeyers91 avatar May 11 '18 18:05 jmeyers91

Hi I am also facing the iOS crash issue. My error log: 2018-09-14 16:43:20.806438+0530 LTJ Shopping[19023:184001] -[__NSArrayM fmToArray]: unrecognized selector sent to instance 0x604000456bf0 2018-09-14 16:43:20.878536+0530 LTJ Shopping[19023:184001] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM fmToArray]: unrecognized selector sent to instance 0x604000456bf0' *** First throw call stack: ( 0 CoreFoundation 0x000000010e25212b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010d25ff41 objc_exception_throw + 48 2 CoreFoundation 0x000000010e2d3024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132 3 CoreFoundation 0x000000010e1d4f78 forwarding + 1432 4 CoreFoundation 0x000000010e1d4958 _CF_forwarding_prep_0 + 120 5 LTJ Shopping 0x0000000105dbc64b +[FMIceLinkAsn1Sequence parseContents:] + 269 6 LTJ Shopping 0x0000000105db7e4b +[FMIceLinkAsn1Any parseBytesInternalWithBytes:offset:byteCount:] + 547 7 LTJ Shopping 0x0000000105db7b52 +[FMIceLinkAsn1Any parseBuffer:offset:byteCount:] + 101 8 LTJ Shopping 0x0000000105db7ae7 +[FMIceLinkAsn1Any parseBuffer:] + 41 9 LTJ Shopping 0x0000000105ee8431 +[FMIceLinkRsaKey parseBuffer:] + 45 10 LTJ Shopping 0x0000000105e93a99 +[FMIceLinkLicense load] + 139 11 libobjc.A.dylib 0x000000010d26169b call_load_methods + 695 12 libobjc.A.dylib 0x000000010d2622f3 load_images + 70 13 ??? 0x0000000107799dac 0x0 + 4420378028 14 ??? 0x00000001077a66c5 0x0 + 4420429509 15 ??? 0x00000001077a5898 0x0 + 4420425880 16 ??? 0x00000001077a592c 0x0 + 4420426028 17 ??? 0x000000010779a17b 0x0 + 4420379003 18 ??? 0x000000010779dc98 0x0 + 4420394136 19 ??? 0x00000001077993d4 0x0 + 4420375508 20 ??? 0x000000010ef14510 0x0 + 4545660176 21 ??? 0x000000010ef12a39 0x0 + 4545653305 22 ??? 0x000000010ef0e249 0x0 + 4545634889 23 ??? 0x000000010ef0e036 0x0 + 4545634358 24 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

nandapuri-evon avatar Sep 14 '18 11:09 nandapuri-evon

I too am getting this error. The plist file is present and linked. The error only began occurring after after upgrading to the latest 5.1.1 version.

Even more confusing, the Xcode terminal provides ZERO additional information. The more verbose react-native log-ios maybe gives a teeny hint:

<Error>: assertion failed: 17C88 15F79: libxpc.dylib + 71445 [C070AA3B-6F2B-3D85-887C-5A00FAE39163]:0x7d
<Error>:
<Notice>: DEPRECATED USE in libdispatch client: Setting timer interval to 0 requests a 1ns timer, did you mean FOREVER (a one-shot timer)?

My Podfile looks like so:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'OllieApp' do
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
     'Core',
     'RCTText',
     'RCTImage',
     'RCTNetwork',
     'RCTSettings',
     'DevSupport',
     'RCTAnimation',
     'RCTWebSocket', # needed for localhost testing of your app
     'CxxBridge',
     # Add any other subspecs you want to use in your project
   ]

  pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  pod 'Firebase/Core', '~> 5.11.0'
  pod 'Firebase/Auth', '~> 5.11.0'
  pod 'Firebase/Firestore', '~> 5.11.0'
  pod 'Firebase/Storage', '~> 5.11.0'
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

If I revert my Podfile to use 5.6.0 and my package.json to use 5.0.0 version of this package, everything works great as expected.

scottmas avatar Dec 13 '18 20:12 scottmas

I am also getting this error. @scottmas is correct. I bumped my versions down and it fixed the issue. My googleservices.plist was definitely added to the project correctly and added to the target. I was using react-native-firebase 5.1.1 Firebase/Core 5.7.0

This would cause my iPhone device (real iPhone 8+) and my simulator to both crash with the error libc++abi.dylib: terminating with uncaught exception, and no other information or stack trace.

I tried many things to fix this but nothing worked. When I bumped down to react-native-firebase 5.0.0 and Firebase/Core 5.6.0 it all started working!

I have now added back in Firebase/Firestore, and Firebase/Auth, and it's still working.

partriv avatar Dec 14 '18 23:12 partriv

Same error here. Bumped down to Firebase/Core 5.6.0 as suggested above. react-native-firebase is still version 5.1.1. Works now.

burntzen avatar Dec 15 '18 12:12 burntzen

Per the comments on the other thread, I tried upgrading to Firebase 5.14.0 in my Podfile, but I got a new error this time (with RN Firebase 5.1.1.):

Module AppRegistry is not a registered callable module (calling runApplication)

The error goes away after reverting back to RN Firebase 5.0.0 and Firebase 5.6.0 in my Podfile.

scottmas avatar Dec 18 '18 15:12 scottmas

It would be helpful if someone could create an Exception Breakpoint in Xcode; in Debug -> Breakpoints. The debugger should then hopefully stop on the line of code where the actual problem is located. A screenshot of this would be helpful.

Thanks

Salakar avatar Dec 18 '18 15:12 Salakar

Screenshot from the error with Firebase 5.11.0 (e.g libc++abi.dylib: terminating with uncaught exception): screen shot 2018-12-18 at 8 41 20 am

scottmas avatar Dec 18 '18 15:12 scottmas

@scottmas interesting, looks like Analytics inside Firebase/Core potentially the issue, what does your Podfile.lock look like, specifically bits that mention Core / Analytics?

Salakar avatar Dec 19 '18 17:12 Salakar

The relevant parts only of my Podfile.lock:

PODS:
  - boost-for-react-native (1.63.0)
  - BoringSSL-GRPC (0.0.2):
    - BoringSSL-GRPC/Implementation (= 0.0.2)
    - BoringSSL-GRPC/Interface (= 0.0.2)
  - BoringSSL-GRPC/Implementation (0.0.2):
    - BoringSSL-GRPC/Interface (= 0.0.2)
  - BoringSSL-GRPC/Interface (0.0.2)
  - DoubleConversion (1.1.6)
  - Firebase/Auth (5.11.0):
    - Firebase/CoreOnly
    - FirebaseAuth (= 5.0.4)
  - Firebase/Core (5.11.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 5.3.0)
  - Firebase/CoreOnly (5.11.0):
    - FirebaseCore (= 5.1.6)
  - Firebase/Firestore (5.11.0):
    - Firebase/CoreOnly
    - FirebaseFirestore (= 0.13.6)
  - Firebase/Storage (5.11.0):
    - Firebase/CoreOnly
    - FirebaseStorage (= 3.0.2)
  - FirebaseAnalytics (5.3.0):
    - FirebaseCore (~> 5.1)
    - FirebaseInstanceID (~> 3.3)
    - GoogleAppMeasurement (~> 5.3)
    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
    - GoogleUtilities/MethodSwizzler (~> 5.2)
    - GoogleUtilities/Network (~> 5.2)
    - "GoogleUtilities/NSData+zlib (~> 5.2)"
    - nanopb (~> 0.3)
  - FirebaseAuth (5.0.4):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 5.0)
    - GoogleUtilities/Environment (~> 5.2)
    - GTMSessionFetcher/Core (~> 1.1)
  - FirebaseAuthInterop (1.0.0)
  - FirebaseCore (5.1.6):
    - GoogleUtilities/Logger (~> 5.2)
  - FirebaseFirestore (0.13.6):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 5.1)
    - FirebaseFirestore/abseil-cpp (= 0.13.6)
    - "gRPC-C++ (~> 0.0.3)"
    - gRPC-ProtoRPC (~> 1.0)
    - leveldb-library (~> 1.20)
    - nanopb (~> 0.3.8)
    - Protobuf (~> 3.1)
  - FirebaseFirestore/abseil-cpp (0.13.6):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 5.1)
    - "gRPC-C++ (~> 0.0.3)"
    - gRPC-ProtoRPC (~> 1.0)
    - leveldb-library (~> 1.20)
    - nanopb (~> 0.3.8)
    - Protobuf (~> 3.1)
  - FirebaseInstanceID (3.3.0):
    - FirebaseCore (~> 5.1)
    - GoogleUtilities/Environment (~> 5.3)
    - GoogleUtilities/UserDefaults (~> 5.3)
  - FirebaseStorage (3.0.2):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 5.0)
    - GTMSessionFetcher/Core (~> 1.1)

scottmas avatar Dec 19 '18 17:12 scottmas

@scottmas can you try force FirebaseAnalytics (= 5.3.0) to version 5.4.0 by adding it to your Podfile with that version, pod installing and seeing how you get on?

Salakar avatar Dec 19 '18 20:12 Salakar