Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] Crashlytics 8.4.2 not collecting on iOS with pods 6.31? #4229

Closed
2 of 10 tasks
abdullahizzuddiin opened this issue Sep 8, 2020 · 80 comments
Closed
2 of 10 tasks
Labels
help: general General help wanted help: ios Needs help implementing or reviewing a PR relating to iOS code. help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report

Comments

@abdullahizzuddiin
Copy link

abdullahizzuddiin commented Sep 8, 2020

[EDITED by @mikehardy 20200913]: it appears the pods 6.28 may work fine with our @react-native-firebase/crashlytics@^8.4.2, but that pods 6.31 does not. This is an area of active investigation. But you may try overriding pods to 6.28 for now. https://rnfirebase.io/#ios

Original issue follows:


Issue

I just upgraded @react-native-firebase/crashlytics from 6.4.0 to 8.4.2. Crash report from iOS didn't displayed on Firebase Console Dashboard.

What I've Done

  • Read [RESOLVED we think] 🔥 Crashlytics 8.0.1 not collecting on iOS #3879
  • removed all fabric related code/config from xschme, project.pbxproj, podfile, podfile.lock
  • added firebase.json
  • ran crashlytics().setCrashlyticsCollectionEnabled(true); in app code
  • triggered crash using crashlytics().crash()
  • Built on Debug and Release mode.
  • Last but not least, wait 8 hours

After all things i've done, nothing resulted to displaying error on my Firebase Console.

This log displayed immediately after app builded and ran on my phone.

[Firebase/Crashlytics] Version 4.4.0
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics] Running on iPhone9,3, 13.7.0 (17H35)
6.30.0 - [Firebase/Crashlytics][I-CLS000000] Root: /var/mobile/Containers/Data/Application/7529E6A5-A2B7-42E4-929B-AF26A1E622AA/Library/Caches/com.crashlytics.data/id.flip.debug
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Registered Firebase Analytics event listener
6.30.0 - [Firebase/Crashlytics][I-CLS000000] Automatic data collection is disabled.
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash] There are no unsent reports.

Sometimes, 1 unsent reports are available. Checking for upload permission. displayed on console. But, nothing happened after I trigger crashlytics().sendUnsentReports();

[Firebase/Crashlytics] Version 4.4.0
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics] Running on iPhone9,3, 13.7.0 (17H35)
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Settings] No settings were cached
se/Crashlytics][I-CLS000000] Root: /var/mobile/Containers/Data/Application/AE3C2DEF-A21A-4722-8F8F-E4B24DDBC49A/Library/Caches/com.crashlytics.data/id.flip.debug
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Registered Firebase Analytics event listener
6.30.0 - [Firebase/Crashlytics][I-CLS000000] Automatic data collection is disabled.
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash] 1 unsent reports are available. Checking for upload permission.
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash] Notifying that unsent reports are available.
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash] Waiting for send/deleteUnsentReports to be called.

I also followed this suggestion. I added

<key>FirebaseCrashlyticsCollectionEnabled</key>
    <true/>

to Info.plist and it gave result.

[Firebase/Crashlytics] Version 4.4.0
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics] Running on iPhone9,3, 13.7.0 (17H35)
6.30.0 - [Firebase/Crashlytics][I-CLS000000] Root: /var/mobile/Containers/Data/Application/B14705F3-E1B1-4C0A-87F0-979DB5891E46/Library/Caches/com.crashlytics.data/id.flip.debug
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Registered Firebase Analytics event listener
6.30.0 - [Firebase/Crashlytics][I-CLS000000] Automatic data collection is enabled.
6.30.0 - [Firebase/Crashlytics][I-CLS000000] Unsent reports will be uploaded at startup

we may highlighted Automatic data collection is enabled. but no crash appeared on firebase console.

On device log, It displayed this error
image


Project Files

Javascript

Click To Expand

package.json:

"dependencies": {
    "@react-native-community/async-storage": "^1.8.1",
    "@react-native-community/cameraroll": "^1.7.2",
    "@react-native-community/netinfo": "^5.6.2",
    "@react-native-community/push-notification-ios": "^1.0.7",
    "@react-native-community/viewpager": "^3.3.0",
    "@react-native-firebase/analytics": "^7.6.1",
    "@react-native-firebase/app": "^8.4.1",
    "@react-native-firebase/crashlytics": "^8.4.2",
    "@react-native-firebase/dynamic-links": "^7.5.2",
    "@react-native-firebase/in-app-messaging": "^7.4.2",
    "@react-native-firebase/messaging": "^7.8.4",
    "@react-native-firebase/perf": "^7.4.2",
    "@react-native-firebase/remote-config": "^9.0.3",
    "appcenter": "^3.0.0",
    "appcenter-analytics": "^3.0.0",
    "appcenter-crashes": "^3.0.0",
    "apsl-react-native-button": "^3.1.1",
    "assert": "^1.4.1",
    "babel-plugin-transform-remove-console": "^6.8.5",
    "crypto-js": "^3.1.9-1",
    "lodash": "^4.17.15",
    "lottie-ios": "^3.1.8",
    "lottie-react-native": "^3.4.0",
    "memoize-one": "^5.1.1",
    "moment": "^2.15.0",
    "moment-timezone": "^0.5.31",
    "prop-types": "^15.7.2",
    "react": "16.9.0",
    "react-native": "^0.61.5",
    "react-native-appsflyer": "^5.2.0",
    "react-native-check-box": "^2.1.7",
    "react-native-code-push": "^6.1.0",
    "react-native-collapsible": "^1.5.1",
    "react-native-config": "^0.11.7",
    "react-native-device-info": "^5.3.1",
    "react-native-emoji": "git+https://github.com/jorilallo/react-native-emoji.git",
    "react-native-fbsdk": "^1.1.2",
    "react-native-freshchat-sdk": "2.6.3",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-hyperlink": "0.0.19",
    "react-native-image-picker": "git+https://github.com/abdullahizzuddiin/react-native-image-picker.git",
    "react-native-intercom": "^13.2.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-material-dropdown": "^0.11.1",
    "react-native-modalbox": "^2.0.0",
    "react-native-onesignal": "git+https://github.com/abdullahizzuddiin/react-native-onesignal.git",
    "react-native-photo-view": "git+https://github.com/alwx/react-native-photo-view.git",
    "react-native-reanimated": "^1.7.0",
    "react-native-router-flux": "^4.2.0",
    "react-native-screens": "^2.3.0",
    "react-native-scrollable-tab-view": "git+https://github.com/abdullahizzuddiin/react-native-scrollable-tab-view.git",
    "react-native-select-contact": "^1.3.2",
    "react-native-simple-toast": "^1.0.0",
    "react-native-spinkit": "^1.5.0",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "rn-fetch-blob": "^0.12.0",
    "stream-browserify": "^2.0.1",
    "timers-browserify": "^2.0.10",
    "tty-browserify": "0.0.1",
    "url": "^0.11.0",
    "vm-browserify": "1.0.1",
    "warning": "^3.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "^7.6.2",
    "@react-native-community/eslint-config": "^0.0.5",
    "@typescript-eslint/eslint-plugin": "^3.8.0",
    "@typescript-eslint/parser": "^3.8.0",
    "babel-jest": "^24.9.0",
    "babel-plugin-module-resolver": "^4.0.0",
    "eslint": "^6.5.1",
    "eslint-import-resolver-babel-module": "^5.1.2",
    "eslint-plugin-import": "^2.22.0",
    "eslint-plugin-module-resolver": "^1.0.0",
    "eslint-plugin-react-native": "^3.8.1",
    "jest": "^24.9.0",
    "jetifier": "^1.6.3",
    "metro-react-native-babel-preset": "^0.56.0",
    "react-devtools": "3.6.2",
    "react-test-renderer": "16.9.0",
    "reactotron-react-native": "^2.1.0",
    "typescript": "^3.9.7"
  }

firebase.json for react-native-firebase v6:

{
  "react-native": {
    "crashlytics_debug_enabled": true,
    "crashlytics_disable_auto_disabler": true,
  }
}

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'AppName' do
  # Pods for your project
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => "../node_modules/react-native/"
  pod 'React-Core', :path => "../node_modules/react-native/"
  pod 'React-CoreModules', :path => "../node_modules/react-native/React/CoreModules"
  pod 'React-Core/DevSupport', :path => "../node_modules/react-native/"
  pod 'React-RCTActionSheet', :path => "../node_modules/react-native/Libraries/ActionSheetIOS"
  pod 'React-RCTAnimation', :path => "../node_modules/react-native/Libraries/NativeAnimation"
  pod 'React-RCTBlob', :path => "../node_modules/react-native/Libraries/Blob"
  pod 'React-RCTImage', :path => "../node_modules/react-native/Libraries/Image"
  pod 'React-RCTLinking', :path => "../node_modules/react-native/Libraries/LinkingIOS"
  pod 'React-RCTNetwork', :path => "../node_modules/react-native/Libraries/Network"
  pod 'React-RCTSettings', :path => "../node_modules/react-native/Libraries/Settings"
  pod 'React-RCTText', :path => "../node_modules/react-native/Libraries/Text"
  pod 'React-RCTVibration', :path => "../node_modules/react-native/Libraries/Vibration"
  pod 'React-Core/RCTWebSocket', :path => "../node_modules/react-native/"
  pod 'React-cxxreact', :path => "../node_modules/react-native/ReactCommon/cxxreact"
  pod 'React-jsi', :path => "../node_modules/react-native/ReactCommon/jsi"
  pod 'React-jsiexecutor', :path => "../node_modules/react-native/ReactCommon/jsiexecutor"
  pod 'React-jsinspector', :path => "../node_modules/react-native/ReactCommon/jsinspector"
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  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"

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

  # Pods for AppName
  pod 'AppCenter/Crashes'
  pod 'AppCenter/Analytics'
  pod 'AppCenterReactNativeShared'

  pod 'FBSDKLoginKit'
  pod 'FBSDKShareKit'

  pod 'Intercom'
  pod 'ZendeskSupportSDK'
  pod 'OneSignal', '>= 2.14.2', '< 3.0'

  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
  pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
  pod 'RCTSelectContact', :path => '../node_modules/react-native-select-contact'

  pod 'react-native-cameraroll', :path => '../node_modules/@react-native-community/cameraroll'

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

  use_native_modules!

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'react-native-config'
        phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
        phase.shell_script = "cd ../../"\
                             " && RNC_ROOT=./node_modules/react-native-config/"\
                             " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
                             " && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\
                             " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"

        target.build_phases << phase
        target.build_phases.move(phase,0)
      end
      if target.name == "React"
        target.remove_from_project
      end
    end
  end
end

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

  # Pods for AppName-tvOS

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

end

target 'OneSignalNotificationServiceExtension' do
  pod 'OneSignal', '>= 2.14.2', '< 3.0'
end

pre_install do |installer|
  # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

AppDelegate.m:

/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import <React/RCTBridge.h>
#import <React/RCTLog.h>
#import "Intercom/intercom.h"
#import "FreshchatSDK.h"

#import "AppDelegate.h"
#import <AppCenterReactNative.h>
#import <AppCenterReactNativeAnalytics.h>
#import <AppCenterReactNativeCrashes.h>
#import <CodePush/CodePush.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <RNCPushNotificationIOS.h>

#import <React/RCTLinkingManager.h>
#if __has_include(<AppsFlyerLib/AppsFlyerTracker.h>)
#import <AppsFlyerLib/AppsFlyerTracker.h>
#else
#import "AppsFlyerTracker.h"
#endif

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
@import SupportSDK;
@import ZendeskCoreSDK;
@import Firebase;
@import AppsFlyerLib;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  //enable debug on release mode, disable when release to user or in debug mode
  //RCTSetLogThreshold(RCTLogLevelInfo - 1);

  // Intercom
  [Intercom setApiKey:@""];

  // Dynamic Links
  [FIROptions defaultOptions].deepLinkURLScheme = @"id.AppName.release";

  // Firebase init
  [FIRApp configure];

  // Freshchat init
  NSString *FRESHCHAT_APP_ID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"FreshchatAppId"];
  NSString *FRESHCHAT_APP_KEY = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"FreshchatAppKey"];

  FreshchatConfig *config = [[FreshchatConfig alloc]initWithAppID:FRESHCHAT_APP_ID  andAppKey:FRESHCHAT_APP_KEY];
  config.gallerySelectionEnabled = YES;
  config.cameraCaptureEnabled = YES;
  config.teamMemberInfoVisible = YES;
  config.showNotificationBanner = YES;
  config.responseExpectationVisible = YES;
  config.domain = @"msdk.au.freshchat.com";
  [[Freshchat sharedInstance] initWithConfig:config];

  [ZDKZendesk initializeWithAppId: @""
    clientId: @""
    zendeskUrl: @""];
  [ZDKSupport initializeWithZendesk: [ZDKZendesk instance]];
  id<ZDKObjCIdentity> userIdentity = [[ZDKObjCAnonymous alloc] initWithName:nil email:nil];
  [[ZDKZendesk instance] setIdentity:userIdentity];


  [AppCenterReactNativeCrashes registerWithAutomaticProcessing];  // Initialize AppCenter crashes

  [AppCenterReactNativeAnalytics registerWithInitiallyEnabled:true];  // Initialize AppCenter analytics

  [AppCenterReactNative register];  // Initialize AppCenter

  [[FBSDKApplicationDelegate sharedInstance] application:application
                           didFinishLaunchingWithOptions:launchOptions];

   RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
   RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                     moduleName:@"AppName"
                                              initialProperties:nil];


  // Sentry init
  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
  center.delegate = self;


  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;
}

- (BOOL)application:(UIApplication *)application
    openURL:(NSURL *)url
		options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {

    [[AppsFlyerTracker sharedTracker] handleOpenUrl:url options:options];

    BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
        openURL:url
		    sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
		    annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
    		];

	return handled;
}

//Universal Links (iOS 9 +)
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
  [[AppsFlyerTracker sharedTracker] continueUserActivity:userActivity restorationHandler:restorationHandler];
  return YES;
}

- (void)applicationDidBecomeActive:(UIApplication *)application{
  /* Reset badge app count if so desired */
}

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
  [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];

  // notify AppsFlyerTracker
  [[AppsFlyerTracker sharedTracker] registerUninstall:deviceToken];
  // Intercom
  [Intercom setDeviceToken:deviceToken];
  // Freshchat
  [[Freshchat sharedInstance] setPushRegistrationToken:deviceToken];
}

- (void) application:(UIApplication *)app didReceiveRemoteNotification:(NSDictionary *)info{
}

// onesignal background notification
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
  [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];

  [self processPaymentInfo: userInfo];

  if ([[Freshchat sharedInstance]isFreshchatNotification:userInfo]) {
    [[Freshchat sharedInstance]handleRemoteNotification:userInfo andAppstate:application.applicationState];
  }
}

/* For devices running on ios 10 and above */
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
       willPresentNotification:(UNNotification *)notification
         withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
          if ([[Freshchat sharedInstance]isFreshchatNotification:notification.request.content.userInfo]) {
            [[Freshchat sharedInstance]handleRemoteNotification:notification.request.content.userInfo andAppstate:[[UIApplication sharedApplication] applicationState]];
            completionHandler( UNAuthorizationOptionSound );
          } else {
              completionHandler( UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge );
          }
}

/* For devices running on ios 10 and above */
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
         withCompletionHandler:(void (^)(void))completionHandler {
  if ([[Freshchat sharedInstance]isFreshchatNotification:response.notification.request.content.userInfo]) {
    [[Freshchat sharedInstance]handleRemoteNotification:response.notification.request.content.userInfo andAppstate:[[UIApplication sharedApplication] applicationState]];
  }
  completionHandler();
}

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

// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
  [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for the localNotification event.
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
  [RNCPushNotificationIOS didReceiveLocalNotification:notification];
}

- (void)processPaymentInfo:(NSDictionary *) additionalData
{
  NSLog(@"ON NOTIFICATION PROCESSING");
  NSLog(@"%@", additionalData);

  NSLog(@"Finishing payment transaction");
  @try {
    int fee = [[additionalData valueForKey:@"biaya"] intValue];
    int status = [[additionalData valueForKey:@"statusTransaksi"] intValue];
    int transactionId = [[additionalData valueForKey:@"idTransaksi"] intValue];
    int transactionType = [[additionalData valueForKey:@"jenis_transaksi"] intValue];

    if (fee > 0 && status == 2) {
      [self finishPayment:transactionId withFee:fee];
    } else if (fee > 0 && status == 6 && transactionType == 6) {
      [self refundPayment:transactionId withFee:fee];
    }

  } @catch (NSException* e) {
    NSLog(@"Payment info exception => %@", e);
  }
}

- (void)finishPayment:(int) transactionId withFee:(int) fee {

  [FIRAnalytics logEventWithName:kFIREventEcommercePurchase parameters:@{
    kFIRParameterTransactionID: [NSString stringWithFormat:@"%d", transactionId],
    kFIRParameterValue: [NSString stringWithFormat:@"%d", fee],
    kFIRParameterCurrency: @"IDR"
  }];
}

- (void)refundPayment:(int) transactionId withFee:(int) fee {
  [FIRAnalytics logEventWithName:kFIREventPurchaseRefund parameters:@{
    kFIRParameterTransactionID: [NSString stringWithFormat:@"%d", transactionId],
    kFIRParameterValue: [NSString stringWithFormat:@"%d", fee],
    kFIRParameterCurrency: @"IDR"
  }];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
  #if DEBUG
    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  #else
    return [CodePush bundleURL];
  #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:

System:
    OS: macOS 10.15.6
    CPU: (4) x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
    Memory: 18.34 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.5.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: /undefined - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: ^0.61.5 => 0.61.5

  • 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:
"@react-native-firebase/analytics": "^7.6.1",
"@react-native-firebase/app": "^8.4.1",
"@react-native-firebase/crashlytics": "^8.4.2",
"@react-native-firebase/dynamic-links": "^7.5.2",
"@react-native-firebase/in-app-messaging": "^7.4.2",
"@react-native-firebase/messaging": "^7.8.4",
"@react-native-firebase/perf": "^7.4.2",
"@react-native-firebase/remote-config": "^9.0.3",
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • N


@abdullahizzuddiin abdullahizzuddiin added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Sep 8, 2020
@rossjohnsonMP
Copy link

as mentioned on #3879 I'm also seeing same issue, anything I can do to help please let me know!

@abdullahizzuddiin
Copy link
Author

Hi @rossjohnsonMP ,
thank you for you willing to help.

Do you have any idea/step/trick to do so my ios crash report can appeared on Firebase Console?

@rossjohnsonMP
Copy link

@abdullahizzuddiin that was more aimed at collaborators or maintainers, I can't help you as I'm in the same position :)

@mikehardy
Copy link
Collaborator

Please confirm these things #3879 (comment)



    use 8.3.2 version or higher
    verify you have a firebase.json in your project - empty if it needs to be (separate issue logged)
    your firebase.json is well-formed JSON, parsing errors will cause silent failure (separate issue logged)
    have the correct keys set for disabling the auto disabler, etc like this perhaps:

{
  "react-native": {
    "crashlytics_disable_auto_disabler": true,
    "crashlytics_debug_enabled": true
  }
}

    run npx react-native-clean-project to make sure you are squeaky clean for your build
    build it and make sure the dSYMS are uploaded
    crash it and then restart the app
    wait a little bit and see ? crossed_fingers

For everyone that has confirmed all those things, we get a report of success.

@abdullahizzuddiin
Copy link
Author

abdullahizzuddiin commented Sep 8, 2020

I followed your suggestion step by step:

  • use 8.3.2 version or higher
    Yes, I use 8.4.2 version
  • verify you have a firebase.json in your project - empty if it needs to be (separate issue logged)
    Yes, code below is my firebase.json file's content
{
  "react-native": {
    "crashlytics_disable_auto_disabler": true,
    "crashlytics_debug_enabled": true
  }
}
  • your firebase.json is well-formed JSON, parsing errors will cause silent failure (separate issue logged)
    Of course. I just copied-pasted from your suggestoin
  • have the correct keys set for disabling the auto disabler, etc like this perhaps:
    Of course. I just copied-pasted from your suggestoin
  • run npx react-native-clean-project to make sure you are squeaky clean for your build
    Clean node_modules, pod dir, build dir. I also did Product -> Clean before build.
  • build it and make sure the dSYMS are uploaded
    Ran ./upload-symbols -gsp ../../GoogleService-Info.debug.plist -p ios ../../../../../AppName.app.dSYM/
    image
  • crash it and then restart the app
  • wait a little bit and see ? 🤞
    I've waited 15 minutes. Still no crash report appeared.
    image

Log appeared on console after my build finished and ran the app.

[Firebase/Crashlytics] Version 4.4.0
[Firebase/Crashlytics][I-CLS000000] [Crashlytics] Running on iPhone9,3, 13.7.0 (17H35)
[Firebase/Crashlytics][I-CLS000000] Root: /var/mobile/Containers/Data/Application/13ADBD41-9A35-40B2-8C5D-774013038616/Library/Caches/com.crashlytics.data/id.AppName.debug
[Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Registered Firebase Analytics event listener
[Firebase/Crashlytics][I-CLS000000] Automatic data collection is enabled.
[Firebase/Crashlytics][I-CLS000000] Unsent reports will be uploaded at startup

Then, I tried to built again. This log appeard on console.

[Firebase/Crashlytics] Packaged report with id 'dc5d9933e4c541c8a2f6ff7c6693713a' for submission
6.30.0 - [Firebase/Crashlytics][I-CLS000000] Preparing the report for the new endpoint: 1
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports] Submitting report
0 Flip[617:178559] 6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Sending event.
6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports] Completed report submission with id: dc5d9933e4c541c8a2f6ff7c6693713a
6.30.0 - [Firebase/Performance][I-PRF100009] Logging network request trace - https://crashlyticsreports-pa.googleapis.com/v1/firelog/legacy/batchlog, Response code: 200, 1568.5920ms
6.30.0 - [Firebase/Performance][I-PRF100009] Logging network request trace - https://crashlyticsreports-pa.googleapis.com/v1/firelog/legacy/batchlog, Response code: 200, 1568.9490ms

Even though log Completed report submission is exist, there is still no crash report appeared on my console.

For more context, I used Crashlytics since it still owned by Fabric. I've removed all code/config (fabric ID, Fabric run script, react-native-fabric/SMXCrashlytics)

@mikehardy
Copy link
Collaborator

Dang, with that "Completed report submission", it seems like it all worked right? I mean, what else can we do 😅 - hopefully it is just a lag in reporting? There was one person that reported it took 15 hours once!?!

Fantastic that you grabbed those logs though, I think they show everything is actually working.

One thing I'll note (though let me say I do not think it is important here) is that npx react-native-clean-project does a lot more than you did. A whole lot more! It cleans Derived Data for iOS builds plus watchman and metro bundler caches and things. Each of those has caused problems in my experience, and given your logs above saying it submitted a report even I don't think it matters now, but it is something to keep in mind

@abdullahizzuddiin
Copy link
Author

abdullahizzuddiin commented Sep 9, 2020

I suspect this is caused by fabric migration.

On 6.4.0 version, crashlytics (android and ios) worked wonderfully.

on 7.* version, rnfb/crashlytics migrated to firebase/crashlytics.

And I upgraded from 6.4.0 to 8.4.2.

Maybe there is something wrong on my fabric migration. Any clue?

@mikehardy
Copy link
Collaborator

I am not sure, it is possible to raise this with the firebase-ios-sdk repo. They do not readily take on issues when react-native-firebase is in use, but if you did a quick reproduction with your firebase credentials plist and a minimal amount of objective-c code that showed the problem you should be able to get attention (they probably have an example you could quickly clone and try?). There are other Fabric customers that reported an inability to see reports after migrating and I don't believe anyone has reported a resolution for it yet

@abdullahizzuddiin
Copy link
Author

I've also generate new main.bundlejs. Old main.bundlejs still have code/configuration related to fabric.

It still didn't worked.

= = =

anyone has tried to abandon old firebase project, and new fresh project with no fabric migration inside?

what problem will be potentially occurred?

@wddwycc
Copy link

wddwycc commented Sep 9, 2020

exactly same issue here

@abdullahizzuddiin
Copy link
Author

Hi @wddwycc,
Would you post your detailed condition?

@wddwycc
Copy link

wddwycc commented Sep 9, 2020

@abdullahizzuddiin @mikehardy

migrating from 6.4.0 to 8.4.2, enabled crashlytics_disable_auto_disabler and crashlytics_debug_enabled , enabled -FIRDebugEnabled for verbose log, using crashlytics().crash to trigger crash, got:

14:35:40.571	Staging	[Firebase/Crashlytics] Packaged report with id '1cb2d91439df4d3294f1ee005c341f63' for submission
14:35:40.585	Staging	6.30.0 - [Firebase/Crashlytics][I-CLS000000] Preparing the report for the new endpoint: 1
14:35:40.588	Staging	6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports] Submitting report
14:35:40.601	Staging	6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Sending event.
14:35:40.635	Staging	6.30.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports] Completed report submission with id: 1cb2d91439df4d3294f1ee005c341f63

The log says report completed, but nothing in my firebase dashboard
(by the way, android works perfectly)

@wddwycc
Copy link

wddwycc commented Sep 9, 2020

@abdullahizzuddiin @mikehardy

This Completed report submission with id log is from firebase-ios-sdk, so I doubt the issue is relevant to firebase server. I sent a ticket to the firebase team, it takes 2 business days for them to respond, let's see

@abdullahizzuddiin
Copy link
Author

What a coincidence. I also sent a ticket to firebase support.

Thanks @wddwycc

@abdullahizzuddiin
Copy link
Author

Firebase support team has answered my ticket and they refused to check because I'm using 3rd party library --not directly using Firebase/Crashlytics

@mikehardy
Copy link
Collaborator

I choose my words carefully @abdullahizzuddiin

They do not readily take on issues when react-native-firebase is in use, but if you did a quick reproduction with your firebase credentials plist and a minimal amount of objective-c code that showed the problem you should be able to get attention (they probably have an example you could quickly clone and try?).

https://github.com/firebase/quickstart-ios/blob/master/crashlytics/README.md

@Daavidaviid
Copy link

Same here.
I spent a lots of time and no success. I followed everything that has been mention here except the part upload-symbols.

@dhoskins
Copy link

Likewise. Not uploading symbols should not prevent crashes appearing.

@Daavidaviid
Copy link

Daavidaviid commented Sep 11, 2020

I did try this : https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports to upload manually.
I ran this command :

ios/Pods/FirebaseCrashlytics/upload-symbols -gsp ios/MyApp/GoogleService-Info.plist -p ios ios/MyApp.app.dSYM.zip

I'm gonna wait a few hours to see if it appears, otherwise I'm lost.

@mikehardy
Copy link
Collaborator

Let me release the current work really quickly - it has been merged but not released. Update your crashlytics in about 30 minutes to the version I will generate and it may help. Adding -FIRDebugEnabled to your launch arguments in your build scheme in Xcode may be illuminating as well

@Daavidaviid
Copy link

Let me release the current work really quickly - it has been merged but not released. Update your crashlytics in about 30 minutes to the version I will generate and it may help. Adding -FIRDebugEnabled to your launch arguments in your build scheme in Xcode may be illuminating as well

Thanks for the help, I’ll check it when it’s out.

@Daavidaviid
Copy link

Thanks for the help, but unfortunately, it doesn't seem to work :/
Is it supposed to work in debug mode ?

My firebase.json:

{
  "react-native": {
    "crashlytics_debug_enabled": true,
    "crashlytics_auto_collection_enabled": true,
    "crashlytics_disable_auto_disabler": true
  }
}

My versions :

{
…
    "@react-native-firebase/analytics": "^7.6.2",
    "@react-native-firebase/app": "^8.4.2",
    "@react-native-firebase/crashlytics": "^8.4.4",
    "@react-native-firebase/messaging": "^7.8.6",
…
}

I've been looking so long at the Add the Firebase iOS SDK (4.3.0 or higher) or Unity Plugin (6.15.0 or higher), then build, run, and crash your app message I'm almost hypnotized.

@mikehardy
Copy link
Collaborator

Adding -FIRDebugEnabled to your launch arguments in your build scheme in Xcode may be illuminating as well

Definitely do this, it (along with a step you need to take in order for it to work with a debugger attached) are detailed here https://firebase.google.com/docs/crashlytics/test-implementation?platform=ios

I have to admit I find it easier to TestFlight a release build personally, but that's for ongoing testing, I understand during initial implementation debug crashes are quite useful

@Daavidaviid
Copy link

Daavidaviid commented Sep 11, 2020

I found a solution !!
So I realized that on another project of mine, it was working great, so I downgraded to the same configuration as my other project, and it worked instantly in DEV, here it is :

    "@react-native-firebase/analytics": "^7.4.1",
    "@react-native-firebase/app": "^8.3.0",
    "@react-native-firebase/messaging": "^7.6.1",
    "@react-native-firebase/crashlytics": "8.3.0",

I'm just scared that I might introduce some breaking change (@mikehardy ?), otherwise it's all good for me.
Might be a good point to start to find why it's not working with the lastest ones

@mikehardy
Copy link
Collaborator

Interesting from exactly what to exactly what versions? Then we can bisect

@Daavidaviid
Copy link

From this :

    "@react-native-firebase/analytics": "^7.6.2",
    "@react-native-firebase/app": "^8.4.2",
    "@react-native-firebase/crashlytics": "^8.4.4", <--
    "@react-native-firebase/messaging": "^7.8.6",

To that :

    "@react-native-firebase/analytics": "^7.4.1",
    "@react-native-firebase/app": "^8.3.0",
    "@react-native-firebase/crashlytics": "8.3.0", <--
    "@react-native-firebase/messaging": "^7.6.1",

@mikehardy
Copy link
Collaborator

How did it go with 8.4.2? There are only 2 changes in Crashlytics in the version range you just mentioned, and you removed both - curious how it goes with only removing the most recent change so you still have the change from 8.4.2

@Daavidaviid
Copy link

I was with the 8.4.2 when I noticed the issue, I tried everything using react-native-clean-project and the right config with firebase.json. But still, no luck.
Did the same thing with 8.4.4 and same results.
And then with 8.3.0 (It was arbitrary, same as another working project) it worked instantly.

@sbatikeri
Copy link

@mikehardy do we going to release any fix soon?

@mikehardy
Copy link
Collaborator

@sbatikeri I don't recall you proposing a PR with a fix? There are explicit mentions above about what needs to be tested to find the problem, then we'll need a fix. I look forward to a PR, I have not had time myself

@MiguelGrability
Copy link

Okay, creating builds with this config

"@react-native-firebase/analytics": "^7.4.1",
"@react-native-firebase/app": "^8.3.0",
"@react-native-firebase/crashlytics": "8.3.0",
"@react-native-firebase/messaging": "^7.6.1",

and

$FirebaseSDKVersion = '6.32.2'

Will report back when I find something out.

I did that and works, but I've felt a little bad downgrading a lot of dependencies, I hope that this works correctly with the latest version soon

@mikehardy
Copy link
Collaborator

@MiguelGrability you don't have to hope! You can do this:

or anyone else following - it does appear the problem is in this library and while crashlytics module 8.3.0 works something in the 5 PRs from that version to current is broken, and the last PR is fine since updated firebase-ios-sdk works, so there's only 4 PRs that could be it.

Of those, 2 are about the manual crash style which may cause issues when testing this library but shouldn't break other crash reports. 1 is for optin/optout (maybe that is it?) and 1 is for including crashlytics without analytics (maybe that is it for project setup where crashlytics thinks you aren't integrated?).

Each is likely testable separately

And advance the issue by discovering the exact change, helping everyone out 🙏

@dooleyb1
Copy link

After a large amount of pain and confusion I too can confirm that downgrading from:

"@react-native-firebase/crashlytics": "8.4.5"

to

"@react-native-firebase/crashlytics": "8.3.0"

as well as setting $FirebaseSDKVersion = '6.32.2' in my Podfile has allowed me to now see crash reports in the Firebase Crashlytics console. Can provide more information regarding environments etc if necessary.

@mikehardy
Copy link
Collaborator

We don't need more information on environments, we need someone with some time to do the version bisect from 8.3.0 to 8.4.5 - as indicated there are really just 2 or 3 changes to consider, so it should be quick work but it hasn't been taken up yet

Sorry this is continuing to sit out there and cause trouble for other developers but I'm out of time to drive it at the moment between apple-auth, this library, device-info, and my work project. We need help if someone has time 🙏

@babeone
Copy link

babeone commented Sep 28, 2020

I did some test with later version, and it stop sending crash report from crashlytics 8.3.2, i've checked the difference between 8.3.0 and 8.3.2. I think this is the issue 6b136c3 , using assert(NO) i was able to recive crash report in the dashboard. Checking the 8.4.5 version and found the RCT_EXPORT_METHOD(crash) in the RNFBCrashlyticsModule.m now use @throw NSInternalInconsistencyException; . So this is not what we are looking, i'll continue testing the library 8.3.2 > X < 8.4.5

@mikehardy
Copy link
Collaborator

@babeone it would be interesting to know if general crashes (as opposed to the "test crash" feature) still worked, as that was a specific area of change here. I'm surprised that caused a problem as it was pretty thoroughly researched and tested, but programming is always surprising. Thank you thank you for investigating, the answer should be in there somewhere...

@babeone
Copy link

babeone commented Sep 28, 2020

@mikehardy Yes, i've tried with 8.3.3 and it's the same as the 8.3.2, with assert(NO) i was able to recive the test crash. When i have time i'll try to crash the app without the crash function.

@mikehardy
Copy link
Collaborator

Relevant comment from @JellyLu on the commit that changed crash style and may be the root cause here, pending testing/confirmation

2cbab5c#commitcomment-43192535

@throw NSInternalInconsistencyException; can crash the app, but firebase console can't get the report. report an issue here.

I try to throw NSInternalInconsistencyException as bellow two ways in AppDelegate.m after the app loading 30 seconds,

way one:

 @throw NSInternalInconsistencyException;

way two:

NSException* myException = [NSException
        exceptionWithName: NSInternalInconsistencyException
        reason:@"V8.4.9 NSInternalInconsistencyException"
        userInfo:nil];
@throw myException;

if I use way one, firebase console will NOT collect the crash,
if I use way two, firebase console will collect the crash.

Could you please help to double check with this?

@mikehardy mikehardy added help: general General help wanted help: ios Needs help implementing or reviewing a PR relating to iOS code. Workflow: Needs Review Pending feedback or review from a maintainer. labels Oct 13, 2020
@se1exin
Copy link

se1exin commented Oct 23, 2020

Hey guys, I've been silently tracking this issue and just wondering about the status of it. Looking at master 2dcaad5 has been merged which appears to fix this issue - is this correct or is there more to it than meets the eye?

@mikehardy
Copy link
Collaborator

@se1exin we can always use more confirmation but it is my understanding that with the correct firebase.json settings and the most recent release, crashes should report on ios in debug and release - in other words, it's supposed to all be working now

@se1exin
Copy link

se1exin commented Oct 30, 2020

Thanks for the update @mikehardy - for what it's worth, I have updated my react-native-firebase/crashlytics to 8.4.11 and can confirm am now receiving manual crash()es in the firebase console for both iOS and Android.

@sbatikeri
Copy link

Updating all worked for me.

    "@react-native-firebase/analytics": "^7.6.9",
    "@react-native-firebase/app": "^8.4.7",
    "@react-native-firebase/crashlytics": "^8.4.12",
    "@react-native-firebase/firestore": "^7.9.1",
    "@react-native-firebase/messaging": "^7.9.2",
    "@react-native-firebase/perf": "^7.4.10",

@Lucasark
Copy link

react-native-firebase/crashlytics to 8.4.11 solved! Thx you guys!

@7772
Copy link

7772 commented Nov 24, 2020

Should check the peerDependence version of each module.

    "@react-native-firebase/analytics": "7.5.1",
    "@react-native-firebase/app": "8.4.0",
    "@react-native-firebase/crashlytics": "8.4.0",
    "@react-native-firebase/firestore": "7.6.1",

@mikehardy
Copy link
Collaborator

@7772 or move to v10+ where we moved to "One.True.Version" and they will no longer be versioned independently, eliminating all confusion

@andersonaddo
Copy link
Contributor

Looks like this is solved; closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: general General help wanted help: ios Needs help implementing or reviewing a PR relating to iOS code. help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report
Projects
None yet
Development

No branches or pull requests