[🐛] libc++abi.dylib: terminating with uncaught exception of type NSException | Terminating app due to uncaught exception ‘NSInvalidArgumentException’

Issue

Using npx react-native with all.
NOTE: changed my ‘real app name’ with ‘myApp’
Getting this error on iOS 14.4 iPhone 11 Simulator & iPhone 12 Real Device

 -[fir_D620517E-4A34-48C6-976A-8A203DA26238_GULNetworkURLSession _flex_swizzle_74b39a6a_URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]: unrecognized selector sent to instance 0x600003e8b4e0

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[fir_D620517E-4A34-48C6-976A-8A203DA26238_GULNetworkURLSession _flex_swizzle_74b39a6a_URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]: unrecognized selector sent to instance


* First throw call stack:
(
	0   CoreFoundation                      0x00007fff20421af6 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff20177e78 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff204306f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
	3   CoreFoundation                      0x00007fff20426036 ___forwarding___ + 1489
	4   CoreFoundation                      0x00007fff20428068 _CF_forwarding_prep_0 + 120
	5   myApp                              0x000000010cceb30f __71+[FLEXNetworkObserver injectDownloadTaskDidWriteDataIntoDelegateClass:]_block_invoke.383 + 79
	6   myApp                              0x000000010ccdefbc +[FLEXNetworkObserver sniffWithoutDuplicationForObject:selector:sniffingBlock:originalImplementationBlock:] + 444
	7   myApp                              0x000000010cceb0d6 __71+[FLEXNetworkObserver injectDownloadTaskDidWriteDataIntoDelegateClass:]_block_invoke_2 + 710
	8   CFNetwork                           0x00007fff236cffd5 _CFNetworkHTTPConnectionCacheSetLimit + 160777
	9   libdispatch.dylib                   0x00000001119227ec _dispatch_call_block_and_release + 12
	10  libdispatch.dylib                   0x00000001119239c8 _dispatch_client_callout + 8
	11  libdispatch.dylib                   0x0000000111931e75 _dispatch_main_queue_callback_4CF + 1152
	12  CoreFoundation                      0x00007fff2038fdbb __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	13  CoreFoundation                      0x00007fff2038a63e __CFRunLoopRun + 2685
	14  CoreFoundation                      0x00007fff203896d6 CFRunLoopRunSpecific + 567
	15  GraphicsServices                    0x00007fff2c257db3 GSEventRunModal + 139
	16  UIKitCore                           0x00007fff24696cf7 -[UIApplication _run] + 912
	17  UIKitCore                           0x00007fff2469bba8 UIApplicationMain + 101
	18  myApp                              0x000000010c652a00 main + 112
	19  libdyld.dylib                       0x00007fff2025a3e9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[fir_D620517E-4A34-48C6-976A-8A203DA26238_GULNetworkURLSession _flex_swizzle_74b39a6a_URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]: unrecognized selector sent to instance 0x600003e8b4e0'
terminating with uncaught exception of type NSException
CoreSimulator 732.18.6 - Device: iPhone 11 (5C776520-5F33-4F6E-8A1F-8E60C6AC34BF) - Runtime: iOS 14.4 (18D46) - DeviceType: iPhone 11

Describe your issue here

I’m trying to use Firebase, as soon as I added and load it in AppDelegate.m it crashes.

Project Files

Javascript

Click To Expand

package.json:

  "name": "myApp",
  "version": "0.0.3-alpha",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.13.4",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^5.9.10",
    "@react-native-firebase/admob": "^10.8.0",
    "@react-native-firebase/analytics": "^10.8.0",
    "@react-native-firebase/app": "^10.8.0",
    "@react-native-firebase/crashlytics": "^10.8.0",
    "@react-native-firebase/dynamic-links": "^10.8.0",
    "@react-native-firebase/iid": "^10.8.0",
    "@react-native-firebase/in-app-messaging": "^10.8.0",
    "@react-native-firebase/messaging": "^10.8.0",
    "@react-native-firebase/perf": "^10.8.0",
    "@react-native-firebase/remote-config": "^10.8.0",
    "@react-navigation/bottom-tabs": "^5.11.7",
    "@react-navigation/compat": "^5.3.13",
    "@react-navigation/drawer": "^5.12.3",
    "@react-navigation/material-bottom-tabs": "^5.3.13",
    "@react-navigation/material-top-tabs": "^5.3.13",
    "@react-navigation/native": "^5.9.2",
    "@react-navigation/stack": "^5.14.2",
    "apisauce": "^2.0.1",
    "lottie-react-native": "^3.5.0",
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-device-info": "^8.0.1",
    "react-native-fbads": "^7.0.3",
    "react-native-fbsdk": "^3.0.0",
    "react-native-gesture-handler": "^1.10.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-paper": "^4.7.1",
    "react-native-permissions": "^3.0.0",
    "react-native-reanimated": "^1.13.2",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.17.1",
    "react-native-shimmer-placeholder": "^2.0.6",
    "react-native-slider-intro": "^1.0.17",
    "react-native-vector-icons": "^8.0.0",
    "react-native-video": "^5.1.1",
    "tipsi-stripe": "^8.0.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.16",
    "@babel/runtime": "^7.12.13",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.19.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.65.0",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

firebase.json for react-native-firebase v6:

{
  "react-native": {
    "admob_android_app_id": "ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXX000",
    "admob_ios_app_id": "ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXX000"
  }
}

iOS

Click To Expand

ios/Podfile:

  • I’m using Pods and my Podfile looks like this:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.0'
target 'myApp' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  # Pods for myApp

  #OpenSSL
  pod 'OpenSSL-Universal'
  #pod 'Stripe'
  pod 'Stripe', '~> 19.4.0'
  # Add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  pod 'Google-Mobile-Ads-SDK'
  pod 'Firebase/AppDistribution'
  pod 'Firebase/Messaging'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/DynamicLinks'
  pod 'Firebase/InAppMessaging'
  pod 'Firebase/Performance'
  pod 'Firebase/RemoteConfig'

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars"
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-Contacts', :path => "#{permissions_path}/Contacts"
  pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary"
  pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  pod 'Permission-Reminders', :path => "#{permissions_path}/Reminders"


  target 'myAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  #use_flipper!
  use_flipper!({ 'Flipper' => '0.75.1' })
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'myApp-tvOS' do
  # Pods for myApp-tvOS

  target 'myApp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

AppDelegate.m:

#import "AppDelegate.h"

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

#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif

@import Firebase;
@import GoogleMobileAds;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  if ([FIRApp defaultApp] == nil) {
    [FIRApp configure];
  }
  [[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
  
  #ifdef FB_SONARKIT_ENABLED
    InitializeFlipper(application);
  #endif

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  #if RCT_DEV //Custom
    [bridge moduleForClass:[RCTDevLoadingView class]];
  #endif
  
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"myApp"
                                            initialProperties:nil];

  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];
  return YES;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

@end


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->

Environment

Click To Expand

react-native info output:

info Fetching system and libraries information...
System:
    OS: macOS 11.2.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 407.67 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.8.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.5.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 27, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.0, 30.0.1
      System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: 22.0.7026061
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6514223
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 15.0.1 - /usr/local/opt/openjdk/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.4 => 0.63.4 
    react-native-macos: ^0.63.16 => 0.63.16
  npmGlobalPackages:
    *react-native*: Not Found

  • Platform that you’re experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you’re using that has this issue:
    • 10.8.0
  • Firebase module(s) you’re using that has the issue:
    • Admob
    • Analytics
    • App
    • Crashlytics
    • Dynamic Links
    • IID
    • In App Messaging
    • Messaging
    • Perf
    • Remote Config
  • Are you using TypeScript?
    • N

1 possible answer(s) on “[🐛] libc++abi.dylib: terminating with uncaught exception of type NSException | Terminating app due to uncaught exception ‘NSInvalidArgumentException’

  1. @seamive Exactly! look
    Flipper >= 0.69 will NOT work with analytics (i don’t know why and i think nobody know it 🙂 ). So you must downgrade Flipper to 0.54 (yeah, it’s by default). But you can see error event2/event.h file not found while app building. Then you need to upgrade Flipper-Folly to 2.3.0

[🐛] libc++abi.dylib: terminating with uncaught exception of type NSException | Terminating app due to uncaught exception ‘NSInvalidArgumentException’

Issue

Using npx react-native with all.
NOTE: changed my ‘real app name’ with ‘myApp’
Getting this error on iOS 14.4 iPhone 11 Simulator & iPhone 12 Real Device

 -[fir_D620517E-4A34-48C6-976A-8A203DA26238_GULNetworkURLSession _flex_swizzle_74b39a6a_URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]: unrecognized selector sent to instance 0x600003e8b4e0

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[fir_D620517E-4A34-48C6-976A-8A203DA26238_GULNetworkURLSession _flex_swizzle_74b39a6a_URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]: unrecognized selector sent to instance


* First throw call stack:
(
	0   CoreFoundation                      0x00007fff20421af6 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff20177e78 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff204306f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
	3   CoreFoundation                      0x00007fff20426036 ___forwarding___ + 1489
	4   CoreFoundation                      0x00007fff20428068 _CF_forwarding_prep_0 + 120
	5   myApp                              0x000000010cceb30f __71+[FLEXNetworkObserver injectDownloadTaskDidWriteDataIntoDelegateClass:]_block_invoke.383 + 79
	6   myApp                              0x000000010ccdefbc +[FLEXNetworkObserver sniffWithoutDuplicationForObject:selector:sniffingBlock:originalImplementationBlock:] + 444
	7   myApp                              0x000000010cceb0d6 __71+[FLEXNetworkObserver injectDownloadTaskDidWriteDataIntoDelegateClass:]_block_invoke_2 + 710
	8   CFNetwork                           0x00007fff236cffd5 _CFNetworkHTTPConnectionCacheSetLimit + 160777
	9   libdispatch.dylib                   0x00000001119227ec _dispatch_call_block_and_release + 12
	10  libdispatch.dylib                   0x00000001119239c8 _dispatch_client_callout + 8
	11  libdispatch.dylib                   0x0000000111931e75 _dispatch_main_queue_callback_4CF + 1152
	12  CoreFoundation                      0x00007fff2038fdbb __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	13  CoreFoundation                      0x00007fff2038a63e __CFRunLoopRun + 2685
	14  CoreFoundation                      0x00007fff203896d6 CFRunLoopRunSpecific + 567
	15  GraphicsServices                    0x00007fff2c257db3 GSEventRunModal + 139
	16  UIKitCore                           0x00007fff24696cf7 -[UIApplication _run] + 912
	17  UIKitCore                           0x00007fff2469bba8 UIApplicationMain + 101
	18  myApp                              0x000000010c652a00 main + 112
	19  libdyld.dylib                       0x00007fff2025a3e9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[fir_D620517E-4A34-48C6-976A-8A203DA26238_GULNetworkURLSession _flex_swizzle_74b39a6a_URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]: unrecognized selector sent to instance 0x600003e8b4e0'
terminating with uncaught exception of type NSException
CoreSimulator 732.18.6 - Device: iPhone 11 (5C776520-5F33-4F6E-8A1F-8E60C6AC34BF) - Runtime: iOS 14.4 (18D46) - DeviceType: iPhone 11

Describe your issue here

I’m trying to use Firebase, as soon as I added and load it in AppDelegate.m it crashes.

Project Files

Javascript

Click To Expand

package.json:

  "name": "myApp",
  "version": "0.0.3-alpha",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.13.4",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^5.9.10",
    "@react-native-firebase/admob": "^10.8.0",
    "@react-native-firebase/analytics": "^10.8.0",
    "@react-native-firebase/app": "^10.8.0",
    "@react-native-firebase/crashlytics": "^10.8.0",
    "@react-native-firebase/dynamic-links": "^10.8.0",
    "@react-native-firebase/iid": "^10.8.0",
    "@react-native-firebase/in-app-messaging": "^10.8.0",
    "@react-native-firebase/messaging": "^10.8.0",
    "@react-native-firebase/perf": "^10.8.0",
    "@react-native-firebase/remote-config": "^10.8.0",
    "@react-navigation/bottom-tabs": "^5.11.7",
    "@react-navigation/compat": "^5.3.13",
    "@react-navigation/drawer": "^5.12.3",
    "@react-navigation/material-bottom-tabs": "^5.3.13",
    "@react-navigation/material-top-tabs": "^5.3.13",
    "@react-navigation/native": "^5.9.2",
    "@react-navigation/stack": "^5.14.2",
    "apisauce": "^2.0.1",
    "lottie-react-native": "^3.5.0",
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-device-info": "^8.0.1",
    "react-native-fbads": "^7.0.3",
    "react-native-fbsdk": "^3.0.0",
    "react-native-gesture-handler": "^1.10.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-paper": "^4.7.1",
    "react-native-permissions": "^3.0.0",
    "react-native-reanimated": "^1.13.2",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.17.1",
    "react-native-shimmer-placeholder": "^2.0.6",
    "react-native-slider-intro": "^1.0.17",
    "react-native-vector-icons": "^8.0.0",
    "react-native-video": "^5.1.1",
    "tipsi-stripe": "^8.0.2"
  },
  "devDependencies": {
    "@babel/core": "^7.12.16",
    "@babel/runtime": "^7.12.13",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.19.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.65.0",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

firebase.json for react-native-firebase v6:

{
  "react-native": {
    "admob_android_app_id": "ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXX000",
    "admob_ios_app_id": "ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXX000"
  }
}

iOS

Click To Expand

ios/Podfile:

  • I’m using Pods and my Podfile looks like this:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.0'
target 'myApp' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  # Pods for myApp

  #OpenSSL
  pod 'OpenSSL-Universal'
  #pod 'Stripe'
  pod 'Stripe', '~> 19.4.0'
  # Add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  pod 'Google-Mobile-Ads-SDK'
  pod 'Firebase/AppDistribution'
  pod 'Firebase/Messaging'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/DynamicLinks'
  pod 'Firebase/InAppMessaging'
  pod 'Firebase/Performance'
  pod 'Firebase/RemoteConfig'

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars"
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-Contacts', :path => "#{permissions_path}/Contacts"
  pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary"
  pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  pod 'Permission-Reminders', :path => "#{permissions_path}/Reminders"


  target 'myAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  #use_flipper!
  use_flipper!({ 'Flipper' => '0.75.1' })
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'myApp-tvOS' do
  # Pods for myApp-tvOS

  target 'myApp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

AppDelegate.m:

#import "AppDelegate.h"

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

#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif

@import Firebase;
@import GoogleMobileAds;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  if ([FIRApp defaultApp] == nil) {
    [FIRApp configure];
  }
  [[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
  
  #ifdef FB_SONARKIT_ENABLED
    InitializeFlipper(application);
  #endif

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  #if RCT_DEV //Custom
    [bridge moduleForClass:[RCTDevLoadingView class]];
  #endif
  
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"myApp"
                                            initialProperties:nil];

  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];
  return YES;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

@end


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->

Environment

Click To Expand

react-native info output:

info Fetching system and libraries information...
System:
    OS: macOS 11.2.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 407.67 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.8.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.5.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 27, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.0, 30.0.1
      System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: 22.0.7026061
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6514223
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 15.0.1 - /usr/local/opt/openjdk/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.4 => 0.63.4 
    react-native-macos: ^0.63.16 => 0.63.16
  npmGlobalPackages:
    *react-native*: Not Found

  • Platform that you’re experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you’re using that has this issue:
    • 10.8.0
  • Firebase module(s) you’re using that has the issue:
    • Admob
    • Analytics
    • App
    • Crashlytics
    • Dynamic Links
    • IID
    • In App Messaging
    • Messaging
    • Perf
    • Remote Config
  • Are you using TypeScript?
    • N

1 possible answer(s) on “[🐛] libc++abi.dylib: terminating with uncaught exception of type NSException | Terminating app due to uncaught exception ‘NSInvalidArgumentException’

  1. @seamive Exactly! look
    Flipper >= 0.69 will NOT work with analytics (i don’t know why and i think nobody know it 🙂 ). So you must downgrade Flipper to 0.54 (yeah, it’s by default). But you can see error event2/event.h file not found while app building. Then you need to upgrade Flipper-Folly to 2.3.0