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

🔥 [🐛] Crash not being sent to Firebase using iOS Debug build configuration #6226

Closed
4 of 10 tasks
lucas-cz opened this issue Apr 28, 2022 · 21 comments · Fixed by #6234
Closed
4 of 10 tasks

🔥 [🐛] Crash not being sent to Firebase using iOS Debug build configuration #6226

lucas-cz opened this issue Apr 28, 2022 · 21 comments · Fixed by #6234
Labels
help: needs-triage Issue needs additional investigation/triaging. platform: ios plugin: crashlytics Firebase Crashlytics resolution: needs-repro This issue could not be reproduced or needs a repro provided. type: bug New bug report Workflow: Needs Review Pending feedback or review from a maintainer.

Comments

@lucas-cz
Copy link

lucas-cz commented Apr 28, 2022

Issue

Crash reports are not being sent to Firebase when building for iOS using Debug build configuration, even with crashlytics_debug_enabled set to true. My configuration is based on this article: https://invertase.io/blog/react-native-firebase-crashlytics-configuration.
For Android (Debug and Release) and iOS (Release) it's working fine.

To test it, i am running the app from Xcode, stopping and reopening it from the desktop icon to prevent the Xcode debugger from blocking the reports.

I have noticed that the Xcode logs (at app launch) are indicating that the library is reading the value of crashlytics_debug_enabled as 0 (line 2):

2022-04-28 16:08:20.954570-0300 TestProject[31949:231843] [Firebase/Crashlytics] Version 8.15.0
2022-04-28 16:08:20.962964-0300 TestProject[31949:231843] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBMeta: 0
2022-04-28 16:08:20.963020-0300 TestProject[31949:231843] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 0
2022-04-28 16:08:20.963064-0300 TestProject[31949:231843] +[RNFBCrashlyticsInitProvider isCrashlyticsCollectionEnabled] [Line 49] RNFBCrashlyticsInit isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: 0
2022-04-28 16:08:20.963877-0300 TestProject[31949:231843] +[RNFBCrashlyticsInitProvider configureWithApp:] [Line 101] RNFBCrashlyticsInit initialization successful
flipper: FlipperClient::addPlugin Inspector
flipper: FlipperClient::addPlugin Preferences
flipper: FlipperClient::addPlugin React
2022-04-28 16:08:21.109236-0300 TestProject[31949:232057] [boringssl] boringssl_metrics_log_metric_block_invoke(153) Failed to log metrics
flipper: FlipperClient::addPlugin Network
2022-04-28 16:08:21.167498-0300 TestProject[31949:232057] [connection] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:21.168259-0300 TestProject[31949:232057] [connection] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:21.168530-0300 TestProject[31949:232057] [connection] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-04-28 16:08:21.168649-0300 TestProject[31949:232057] TCP Conn 0x600001a808f0 Failed : error 0:61 [61]
2022-04-28 16:08:21.218379-0300 TestProject[31949:231843] [native] Running application TestProject ({
    initialProps =     {
    };
    rootTag = 1;
})
2022-04-28 16:08:21.437065-0300 TestProject[31949:232058] [boringssl] boringssl_metrics_log_metric_block_invoke(153) Failed to log metrics
2022-04-28 16:08:23.236955-0300 TestProject[31949:232053] [connection] nw_socket_handle_socket_event [C8.1:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:23.238293-0300 TestProject[31949:232053] [connection] nw_socket_handle_socket_event [C8.2:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:23.239192-0300 TestProject[31949:232053] [connection] nw_connection_get_connected_socket [C8] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-04-28 16:08:23.239394-0300 TestProject[31949:232053] TCP Conn 0x600001a90160 Failed : error 0:61 [61]
2022-04-28 16:08:25.245975-0300 TestProject[31949:232053] [connection] nw_socket_handle_socket_event [C9.1:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:25.247816-0300 TestProject[31949:232053] [connection] nw_socket_handle_socket_event [C9.2:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:25.249312-0300 TestProject[31949:232053] [connection] nw_connection_get_connected_socket [C9] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-04-28 16:08:25.249624-0300 TestProject[31949:232053] TCP Conn 0x600001a90370 Failed : error 0:61 [61]
2022-04-28 16:08:27.257305-0300 TestProject[31949:232058] [connection] nw_socket_handle_socket_event [C10.1:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:27.258578-0300 TestProject[31949:232058] [connection] nw_socket_handle_socket_event [C10.2:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:27.259311-0300 TestProject[31949:232058] [connection] nw_connection_get_connected_socket [C10] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-04-28 16:08:27.259582-0300 TestProject[31949:232058] TCP Conn 0x600001a98160 Failed : error 0:61 [61]
2022-04-28 16:08:31.329579-0300 TestProject[31949:232069] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBMeta: 0
2022-04-28 16:08:31.329686-0300 TestProject[31949:232069] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 0
2022-04-28 16:08:31.329737-0300 TestProject[31949:232069] +[RNFBCrashlyticsInitProvider isCrashlyticsCollectionEnabled] [Line 49] RNFBCrashlyticsInit isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: 0
2022-04-28 16:08:31.329784-0300 TestProject[31949:232069] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled via RNFBMeta: 1
2022-04-28 16:08:31.329820-0300 TestProject[31949:232069] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled final value: 1
2022-04-28 16:08:31.329889-0300 TestProject[31949:232069] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled via RNFBMeta: 1
2022-04-28 16:08:31.331824-0300 TestProject[31949:232069] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled final value: 1
2022-04-28 16:08:31.332070-0300 TestProject[31949:232069] [native] Crashlytics - WARNING: Debugger detected. Crashlytics will not receive crash reports.
2022-04-28 16:08:31.334713-0300 TestProject[31949:232059] [connection] nw_socket_handle_socket_event [C11.1:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:31.335200-0300 TestProject[31949:232059] [connection] nw_socket_handle_socket_event [C11.2:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:31.335414-0300 TestProject[31949:232056] [connection] nw_connection_get_connected_socket [C11] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-04-28 16:08:31.335499-0300 TestProject[31949:232056] TCP Conn 0x600001a84c60 Failed : error 0:61 [61]
2022-04-28 16:08:31.360490-0300 TestProject[31949:232069] [javascript] Running "TestProject" with {"rootTag":1,"initialProps":{}}
2022-04-28 16:08:37.309764-0300 TestProject[31949:232056] [connection] nw_socket_handle_socket_event [C13.1:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:37.312186-0300 TestProject[31949:232056] [connection] nw_socket_handle_socket_event [C13.2:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:37.312970-0300 TestProject[31949:232056] [connection] nw_connection_get_connected_socket [C13] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-04-28 16:08:37.315232-0300 TestProject[31949:232056] TCP Conn 0x600001a8be90 Failed : error 0:61 [61]
2022-04-28 16:08:39.322811-0300 TestProject[31949:232052] [connection] nw_socket_handle_socket_event [C14.1:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:39.324247-0300 TestProject[31949:232052] [connection] nw_socket_handle_socket_event [C14.2:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:39.325305-0300 TestProject[31949:232052] [connection] nw_connection_get_connected_socket [C14] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-04-28 16:08:39.325450-0300 TestProject[31949:232052] TCP Conn 0x600001a94000 Failed : error 0:61 [61]
2022-04-28 16:08:41.333612-0300 TestProject[31949:232052] [connection] nw_socket_handle_socket_event [C15.1:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:41.335173-0300 TestProject[31949:232052] [connection] nw_socket_handle_socket_event [C15.2:1] Socket SO_ERROR [61: Connection refused]
2022-04-28 16:08:41.336404-0300 TestProject[31949:232052] [connection] nw_connection_get_connected_socket [C15] Client called nw_connection_get_connected_socket on unconnected nw_connection
2022-04-28 16:08:41.337230-0300 TestProject[31949:232052] TCP Conn 0x600001a880b0 Failed : error 0:61 [61]

The app that I am using is a Sample React Native App created with npx react-native init and the following App.js:

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';
import type {Node} from 'react';
import crashlytics from '@react-native-firebase/crashlytics';
import {SafeAreaView, useColorScheme, Button} from 'react-native';

import {Colors} from 'react-native/Libraries/NewAppScreen';

const App: () => Node = () => {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  return (
    <SafeAreaView style={backgroundStyle}>
      <Button
        title="Record error"
        onPress={() => crashlytics().recordError(new Error('RECORD ERROR'))}
      />
      <Button title="Crash" onPress={() => crashlytics().crash()} />
    </SafeAreaView>
  );
};

export default App;

Project Files

Javascript

Click To Expand

package.json:

{
  "name": "testproject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-firebase/app": "^14.9.1",
    "@react-native-firebase/crashlytics": "^14.9.1",
    "react": "17.0.2",
    "react-native": "0.68.1"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.32.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.67.0",
    "react-test-renderer": "17.0.2"
  },
  "jest": {
    "preset": "react-native"
  }
}

firebase.json for react-native-firebase v6:

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

iOS

Click To Expand

ios/Podfile:

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

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'TestProject' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'TestProjectTests' 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 the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

AppDelegate.m:

#import "AppDelegate.h"

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

#import <React/RCTAppSetupUtils.h>

#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#import <React/RCTSurfacePresenter.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>
#import <ReactCommon/RCTTurboModuleManager.h>

#import <react/config/ReactNativeConfig.h>

@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
  RCTTurboModuleManager *_turboModuleManager;
  RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
  std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
  facebook::react::ContextContainer::Shared _contextContainer;
}
@end
#endif

@implementation AppDelegate

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

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];

#if RCT_NEW_ARCH_ENABLED
  _contextContainer = std::make_shared<facebook::react::ContextContainer const>();
  _reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
  _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
  _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
  bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif

  UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"TestProject", nil);

  if (@available(iOS 13.0, *)) {
    rootView.backgroundColor = [UIColor systemBackgroundColor];
  } else {
    rootView.backgroundColor = [UIColor whiteColor];
  }

  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"];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

#if RCT_NEW_ARCH_ENABLED

#pragma mark - RCTCxxBridgeDelegate

- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
{
  _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
                                                             delegate:self
                                                            jsInvoker:bridge.jsCallInvoker];
  return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
}

#pragma mark RCTTurboModuleManagerDelegate

- (Class)getModuleClassFromName:(const char *)name
{
  return RCTCoreModulesClassProvider(name);
}

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
                                                      jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
{
  return nullptr;
}

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
                                                     initParams:
                                                         (const facebook::react::ObjCTurboModule::InitParams &)params
{
  return nullptr;
}

- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
{
  return RCTAppSetupDefaultModuleFromClass(moduleClass);
}

#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 12.3.1
    CPU: (8) arm64 Apple M1
    Memory: 113.05 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.5.0 - /usr/local/bin/npm
    Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8193401
    Xcode: 13.3/13E113 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.14.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.1 => 0.68.1 
    react-native-macos: Not Found
  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:
    • 14.9.1
  • Firebase module(s) you're using that has the issue:
    • Crashlytics
  • Are you using TypeScript?
    • N


@lucas-cz lucas-cz added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Apr 28, 2022
@mikehardy
Copy link
Collaborator

Strange! I just tested this as part of triage for #6207 - and I never saw it fail while I think the issue submitter there never achieved success. It was quite odd, and not the normal resolution.

That said: I had successful reports in crashlytics dashboard (following successful messaging from the app during boot).

So, this is likely not the fault of the Xcode launch blocking things - you get a different warning in the logs from that:

if ([self isDebuggerAttached]) {
RCTLog(
@"Crashlytics - WARNING: Debugger detected. Crashlytics will not receive crash reports.");
}

Why isn't it detecting that you have enabled things? Unsure, but a common mental model issue is the idea that you change firebase.json then re-run the app and it should work. In fact, you have to change firebase.json, re-run pod install, then run the app and it should work. Why? Because what you want with your firebase.json changes is to actually change Info.plist values (that's where the settings really take hold), and that's only possible if code runs, we run the code that carries values from firebase.json into Info.plist as a pod install ruby script. On android we have gradle power during the build so we're able to do it at build time not install time.

Did you definitely run pod install after firebase.json changes? That's the first thing to examine.

As for avoiding Xcode debugger, I use a version of this simctl command for direct logging when testing crashlytics (usually with out to a file, and then with a grep/search for the crashlytics messages), so I may see the logs and avoid the debugger (it's also what we use in iOS e2e testing in CI to save the simulator log for inspection as needed):

run: nohup sh -c "sleep 30 && xcrun simctl spawn booted log stream --level debug --style compact > simulator.log 2>&1 &"

Hopefully that's enough to go on to move things forward a bit?

@mikehardy
Copy link
Collaborator

You might post your firebase.json as well - with anything proprietary stripped out fine - just to see what it looks like for reproduction if the above doesn't help

@dhruvasagar
Copy link

dhruvasagar commented Apr 29, 2022

I have been debugging for 2 days, this just isn't working. I have followed all advice.
Here are the issues I see :

  • iOS FNFBCrashyticsInit is not picking up values from the firebase.json. For this reason it's not enabled and debug mode and hence not testable. I can see the following in the logs for reference : crashlytics collection is not enabled, not crashing.
  • crashlytics().crash() is working in Release build, however, nothing is reported on Firebase Crashlytics dashboard for the iOS app. I see the following error in xcode that may be the reason :
2022-04-29 11:26:04.454595+0530 DmgPro[7158:388927] 8.12.1 - [Firebase/Crashlytics][I-CLS000000] Failed to download settings. If this is your first time launching the app, make sure you have enabled Crashlytics in the Firebase Console. Error Domain=FIRCLSNetworkError Code=-5 "(null)"

Crashlytics is working for android, but not for iOS and I can't even tell why the above are not working.

I have

@mikehardy
Copy link
Collaborator

Note that on the crashlytics dashboard the android and ios apps are separate, you have to switch between them in a dropdown near top left. Also, the report is not seen until next app startup. You may have already handled those things. In the meantime @dhruvasagar you haven't provided enough information on your specific problem (with different versions and different configs and different test environment you might have a subtly different problem...), sorry, and I haven't heard back from the original submitter yet.

@lucas-cz
Copy link
Author

@mikehardy it's good to know what you said about running pod install. I tried to run it after editing the firebase.json file, but with no luck.
The logs using xcrun simctl spawn booted log stream --level debug --style compact | grep "crashlytics" are still showing crashlytics_debug_enabled as 0:

2022-04-29 11:00:45.827 Db TestProject[3173:93e3] [com.apple.defaults:User Defaults] found no value for key crashlytics_debug_enabled in CFPrefsSearchListSource<0x6000029e6480> (Domain: io.invertase.firebase, Container: (null))
2022-04-29 11:00:45.827 Df TestProject[3173:93e3] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBMeta: 0
2022-04-29 11:00:45.827 Df TestProject[3173:93e3] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 0
2022-04-29 11:00:45.827 Df TestProject[3173:93e3] +[RNFBCrashlyticsInitProvider isCrashlyticsCollectionEnabled] [Line 49] RNFBCrashlyticsInit isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: 0
2022-04-29 11:00:45.858 Df TestProject[3173:93ff] [com.apple.network:connection] [C1 8816356F-2DE6-4C76-AC01-D3EDDB258ED5 firebase-settings.crashlytics.com:443 tcp, url hash: 97e9cb8c, tls, definite, attribution: developer, context: com.apple.CFNetwork.NSURLSession.{58B7206B-42F9-4CAD-8A98-FA341AC324F5}{(null)}{Y}{2} (private), proc: B95389BE-F452-39C6-8F2F-2A11C450FFE7] start
2022-04-29 11:00:45.858 I  TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_handler_start [C1 firebase-settings.crashlytics.com:443 initial path ((null))]
2022-04-29 11:00:45.858 Df TestProject[3173:93ff] [com.apple.network:connection] [C1 firebase-settings.crashlytics.com:443 initial path ((null))] event: path:start @0.000s
2022-04-29 11:00:45.861 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_handler_path_change [C1 firebase-settings.crashlytics.com:443 waiting path (satisfied (Path is satisfied), interface: en0)]
2022-04-29 11:00:45.861 Df TestProject[3173:93ff] [com.apple.network:connection] [C1 firebase-settings.crashlytics.com:443 waiting path (satisfied (Path is satisfied), interface: en0)] event: path:satisfied @0.002s, uuid: 0E823A30-A8E0-4EBD-906E-BB0BA77FA113
2022-04-29 11:00:45.861 I  TestProject[3173:93ff] [com.apple.network:connection] nw_connection_endpoint_report_on_nw_queue [C1 firebase-settings.crashlytics.com:443 waiting path (satisfied (Path is satisfied), interface: en0)] skipping state update
2022-04-29 11:00:45.861 Db TestProject[3173:93ff] [com.apple.network:] nw_endpoint_proxy_handler_should_use_proxy Looking up proxy for hostname: firebase-settings.crashlytics.com, ifindex: 0
2022-04-29 11:00:45.862 Db TestProject[3173:93ff] [com.apple.network:connection] -[NWConcrete_nw_endpoint_resolver startWithHandler:] [C1 firebase-settings.crashlytics.com:443 waiting resolver (satisfied (Path is satisfied), interface: en0)]
2022-04-29 11:00:45.863 Df TestProject[3173:93ff] [com.apple.network:connection] [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] event: resolver:start_dns @0.004s
2022-04-29 11:00:45.864 I  TestProject[3173:93ff] [com.apple.network:connection] nw_resolver_create_dns_service_locked [C1] Starting host resolution firebase-settings.crashlytics.com:443, flags 0xc000d000 proto 0
2022-04-29 11:00:45.866 I  TestProject[3173:93ff] [com.apple.network:connection] nw_resolver_host_resolve_callback [C1] flags=0x40000003 ifindex=0 error=NoSuchRecord(-65554) hostname=firebase-settings.crashlytics.com. addr=:: ttl=60
2022-04-29 11:00:45.872 I  TestProject[3173:93ff] [com.apple.network:connection] nw_resolver_host_resolve_callback [C1] flags=0x40000002 ifindex=0 error=NoError(0) hostname=firebase-settings.crashlytics.com. addr=172.217.172.67 ttl=115
2022-04-29 11:00:45.872 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_update [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] resolver is complete
2022-04-29 11:00:45.872 Df TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_update [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] Adding endpoint handler for 172.217.172.67:443
2022-04-29 11:00:45.872 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_update [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] Updated endpoint list is (172.217.172.67:443)
2022-04-29 11:00:45.872 Df TestProject[3173:93ff] [com.apple.network:connection] [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] event: resolver:receive_dns @0.013s
2022-04-29 11:00:45.872 I  TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_start_next_child [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] starting child endpoint 172.217.172.67:443
2022-04-29 11:00:45.872 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_receive_report [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] received child report: [C1.1 172.217.172.67:443 initial path ((null))]
2022-04-29 11:00:45.873 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_receive_report [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] received child report: [C1.1 172.217.172.67:443 waiting path (satisfied (Path is satisfied), interface: en0)]
2022-04-29 11:00:45.878 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_receive_report [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] received child report: [C1.1 172.217.172.67:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en0)]
2022-04-29 11:00:45.880 I  TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_start_next_child [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] starting next child endpoint in 100ms
2022-04-29 11:00:45.888 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_receive_report [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] received child report: [C1.1 172.217.172.67:443 in_progress socket-flow (satisfied (Path is satisfied), interface: en0)]
2022-04-29 11:00:45.888 Df TestProject[3173:93ff] [com.apple.network:connection] [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] event: flow:finish_transport @0.030s
2022-04-29 11:00:45.941 Db trustd[958:905f] [com.apple.securityd:accept] replacing non ev reject score: 0 with non ev score: 10011117 <SecCertificatePathVC certs: <cert(0x15a809a00) s: crashlytics.com i: GTS CA 1C3>, <cert(0x15a818400) s: GTS CA 1C3 i: GTS Root R1>, <cert(0x15b007e80) s: GTS Root R1 i: GTS Root R1> >
2022-04-29 11:00:45.941 Db trustd[958:905f] [com.apple.securityd:trust] completed: <SecCertificatePathVC certs: <cert(0x15a809a00) s: crashlytics.com i: GTS CA 1C3>, <cert(0x15a818400) s: GTS CA 1C3 i: GTS Root R1>, <cert(0x15b007e80) s: GTS Root R1 i: GTS Root R1> > details: (
2022-04-29 11:00:45.944 Db trustd[958:905f] [com.apple.securityd:accept] replacing non ev reject score: 0 with non ev score: 10011117 <SecCertificatePathVC certs: <cert(0x15980c400) s: crashlytics.com i: GTS CA 1C3>, <cert(0x15980cc00) s: GTS CA 1C3 i: GTS Root R1>, <cert(0x15b009e80) s: GTS Root R1 i: GTS Root R1> >
2022-04-29 11:00:45.945 Db trustd[958:905f] [com.apple.securityd:trust] completed: <SecCertificatePathVC certs: <cert(0x15980c400) s: crashlytics.com i: GTS CA 1C3>, <cert(0x15980cc00) s: GTS CA 1C3 i: GTS Root R1>, <cert(0x15b009e80) s: GTS Root R1 i: GTS Root R1> > details: (
2022-04-29 11:00:45.949 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_receive_report [C1 firebase-settings.crashlytics.com:443 in_progress resolver (satisfied (Path is satisfied), interface: en0)] received child report: [C1.1 172.217.172.67:443 ready socket-flow (satisfied (Path is satisfied), interface: en0)]
2022-04-29 11:00:45.956 Df TestProject[3173:93ff] [com.apple.network:connection] [C1 firebase-settings.crashlytics.com:443 ready resolver (satisfied (Path is satisfied), interface: en0)] event: flow:finish_connect @0.097s
2022-04-29 11:00:45.956 Db TestProject[3173:93ff] [com.apple.network:connection] nw_endpoint_resolver_receive_report [C1 firebase-settings.crashlytics.com:443 ready resolver (satisfied (Path is satisfied), interface: en0)] received child report: [C1.1 172.217.172.67:443 ready socket-flow (satisfied (Path is satisfied), interface: en0)]
2022-04-29 11:00:45.956 Df TestProject[3173:93ff] [com.apple.network:connection] [C1 firebase-settings.crashlytics.com:443 ready resolver (satisfied (Path is satisfied), interface: en0)] event: flow:changed_viability @0.097s
2022-04-29 11:00:45.957 Db TestProject[3173:93ff] [com.apple.CFNetwork:Coalescing] new connection to firebase-settings.crashlytics.com config 0x6000007e3640
2022-04-29 11:00:46.249 Df TestProject[3173:93fe] [com.apple.network:connection] [C1 8816356F-2DE6-4C76-AC01-D3EDDB258ED5 firebase-settings.crashlytics.com:443 tcp, url hash: 97e9cb8c, tls, definite, attribution: developer] cancel
2022-04-29 11:00:46.249 Df TestProject[3173:93fe] [com.apple.network:connection] [C1 8816356F-2DE6-4C76-AC01-D3EDDB258ED5 firebase-settings.crashlytics.com:443 tcp, url hash: 97e9cb8c, tls, definite, attribution: developer] cancelled
2022-04-29 11:00:46.249 I  TestProject[3173:93fe] [com.apple.network:connection] nw_endpoint_handler_cancel [C1 firebase-settings.crashlytics.com:443 ready resolver (satisfied (Path is satisfied), interface: en0)]
2022-04-29 11:00:46.249 I  TestProject[3173:93fe] [com.apple.network:connection] nw_association_schedule_deactivation <nw_association firebase-settings.crashlytics.com:443> will become dormant after 10000ms of inactivity
2022-04-29 11:00:46.250 I  TestProject[3173:93fe] [com.apple.network:connection] [C1 firebase-settings.crashlytics.com:443 tcp, url hash: 97e9cb8c, tls, definite, attribution: developer] dealloc
2022-04-29 11:00:47.153 Db TestProject[3173:9413] [com.apple.defaults:User Defaults] found no value for key crashlytics_debug_enabled in CFPrefsSearchListSource<0x6000029e6480> (Domain: io.invertase.firebase, Container: (null))
2022-04-29 11:00:47.153 Df TestProject[3173:9413] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBMeta: 0
2022-04-29 11:00:47.153 Df TestProject[3173:9413] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 0
2022-04-29 11:00:47.153 Df TestProject[3173:9413] +[RNFBCrashlyticsInitProvider isCrashlyticsCollectionEnabled] [Line 49] RNFBCrashlyticsInit isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: 0
2022-04-29 11:00:47.153 Db TestProject[3173:9413] [com.apple.defaults:User Defaults] found no value for key crashlytics_is_error_generation_on_js_crash_enabled in CFPrefsSearchListSource<0x6000029e6480> (Domain: io.invertase.firebase, Container: (null))
2022-04-29 11:00:47.153 Df TestProject[3173:9413] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled via RNFBMeta: 1
2022-04-29 11:00:47.153 Df TestProject[3173:9413] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled final value: 1
2022-04-29 11:00:47.153 Db TestProject[3173:9413] [com.apple.defaults:User Defaults] found no value for key crashlytics_javascript_exception_handler_chaining_enabled in CFPrefsSearchListSource<0x6000029e6480> (Domain: io.invertase.firebase, Container: (null))
2022-04-29 11:00:47.153 Df TestProject[3173:9413] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 157] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled via RNFBMeta: 1
2022-04-29 11:00:47.153 Df TestProject[3173:9413] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled final value: 1

@lucas-cz
Copy link
Author

You might post your firebase.json as well - with anything proprietary stripped out fine - just to see what it looks like for reproduction if the above doesn't help

My firebase.json file is posted as part of the description, as indicated in the template.
Anyway, this is how it looks:

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

@mikehardy
Copy link
Collaborator

Sorry I missed the firebase.json! That all looks good

🤔 I'll have to take another crack at reproducing this. The main thing I see is that our e2e test app is on react-native 0.67 still, not 0.68, and I was checking on that.

Have you tried this on react-native 0.67 for comparison? Just curious. I won't have time to compare 67 vs 68 react-native versions for a little bit unfortunately, but right now that's all I can think of as a difference between what I see working and what you are reporting not working

@mikehardy mikehardy added platform: ios resolution: needs-repro This issue could not be reproduced or needs a repro provided. plugin: crashlytics Firebase Crashlytics Workflow: Needs Review Pending feedback or review from a maintainer. labels Apr 29, 2022
@mikehardy
Copy link
Collaborator

One other thought - you can check the generated info.plist file from the build directory to see the results (or lack of same) from our ruby script, it will show whether interpolation is working, the script itself is in our app package

@dhruvasagar
Copy link

@mikehardy I have the exact same firebase.json as mentioned in this issue. I am on React 0.66.0.

I have tried several work arounds, suggestions, but nothing had made any difference.

@mikehardy
Copy link
Collaborator

mikehardy commented Apr 29, 2022

Okay - I definitely had success with it on react-native 0.66.x. Really odd. Perhaps something about the ruby + cocoapods execution environment?

Rather than speculate about what might work, here's evidence from the latest E2E run. We preserve simulator logs as a GitHub workflow artifacts, so you can see the log here https://github.com/invertase/react-native-firebase/actions/runs/2245976888

And you can see all of the software versions in question by referring off the workflow run's definition + system image

And it is working 🤔

2022-04-29 14:59:28.071 Df testing[9456:c04a] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2022-04-29 14:59:28.071 Df testing[9456:c04a] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2022-04-29 14:59:28.071 Df testing[9456:c04a] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBJSON: 1
2022-04-29 14:59:28.072 Df testing[9456:c04a] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2022-04-29 14:59:28.072 Df testing[9456:c04a] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled via RNFBJSON: 1
2022-04-29 14:59:28.072 Df testing[9456:c04a] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled final value: 1
2022-04-29 14:59:28.072 Df testing[9456:c04a] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled via RNFBJSON: 0
2022-04-29 14:59:28.072 Df testing[9456:c04a] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled final value: 0
2022-04-29 14:59:28.794 Df testing[9456:c0ab] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2022-04-29 14:59:28.794 Df testing[9456:c0ab] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2022-04-29 14:59:28.794 Df testing[9456:c0ab] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBJSON: 1
2022-04-29 14:59:28.794 Df testing[9456:c0ab] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2022-04-29 14:59:28.795 Df testing[9456:c0ab] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled via RNFBJSON: 1
2022-04-29 14:59:28.795 Df testing[9456:c0ab] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_is_error_generation_on_js_crash_enabled final value: 1
2022-04-29 14:59:28.795 Df testing[9456:c0ab] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled via RNFBJSON: 0
2022-04-29 14:59:28.795 Df testing[9456:c0ab] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_javascript_exception_handler_chaining_enabled final value: 0
2022-04-29 15:00:03.078 Df testing[9456:bfd2] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2022-04-29 15:00:03.078 Df testing[9456:bfd2] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2022-04-29 15:00:03.078 Df testing[9456:bfd2] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBJSON: 1
2022-04-29 15:00:03.078 Df testing[9456:bfd2] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2022-04-29 15:00:03.110 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2022-04-29 15:00:03.110 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2022-04-29 15:00:03.111 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBJSON: 1
2022-04-29 15:00:03.111 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2022-04-29 15:00:03.185 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2022-04-29 15:00:03.185 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2022-04-29 15:00:03.186 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 145] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBPreferences: 1
2022-04-29 15:00:03.186 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2022-04-29 15:00:03.188 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2022-04-29 15:00:03.188 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2022-04-29 15:00:03.188 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 145] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBPreferences: 1
2022-04-29 15:00:03.188 Df testing[9456:c0f7] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2022-04-29 15:01:25.961 Df testing[9456:bfb6] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 150] RNFBCrashlyticsInit crashlytics_debug_enabled via RNFBJSON: 1
2022-04-29 15:01:25.961 Df testing[9456:bfb6] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_debug_enabled final value: 1
2022-04-29 15:01:25.961 Df testing[9456:bfb6] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 145] RNFBCrashlyticsInit crashlytics_auto_collection_enabled via RNFBPreferences: 1
2022-04-29 15:01:25.961 Df testing[9456:bfb6] +[RNFBSharedUtils getConfigBooleanValue:key:defaultValue:] [Line 160] RNFBCrashlyticsInit crashlytics_auto_collection_enabled final value: 1
2022-04-29 15:01:25.961 Df testing[9456:bfb6] +[RNFBCrashlyticsInitProvider configureWithApp:] [Line 101] RNFBCrashlyticsInit initialization successful
mike@bistromath:~/TEMP % 

Maybe intel mac vs M1 mac? But in the other recent issue like this (#6207) that was an intel mac. Most of my testing is intel mac so it's a possible difference but I assign low-probability.

Very curious for results of inspection of the processed / pre-pack-into-.app Info.plist

For our e2e app named testing that's ./ios/build/Build/Products/Debug-iphonesimulator/testing.app/Info.plist

When I take the firebase_json_raw key out of that and sent it through https://www.base64decode.org/ I get this when pretty-printed

{
  "messaging_android_notification_channel_id": "",
  "app_data_collection_default_enabled": false,
  "google_analytics_automatic_screen_reporting_enabled": true,
  "android_task_executor_maximum_pool_size": 10,
  "messaging_android_headless_task_timeout": 30000,
  "crashlytics_debug_enabled": true,
  "android_background_activity_names": "NotActuallyAnActivity",
  "google_analytics_ssaid_collection_enabled": true,
  "analytics_collection_deactivated": false,
  "messaging_android_notification_color": "@color/hotpink",
  "rnfirebase_json_testing_boolean_true": true,
  "crashlytics_auto_collection_enabled": true,
  "analytics_auto_collection_enabled": true,
  "in_app_messaging_auto_collection_enabled": false,
  "android_bypass_emulator_url_remap": false,
  "crashlytics_disable_auto_disabler": true,
  "android_task_executor_keep_alive_seconds": 3,
  "app_log_level": "debug",
  "crashlytics_javascript_exception_handler_chaining_enabled": false,
  "analytics_default_allow_ad_personalization_signals": true,
  "perf_auto_collection_enabled": false,
  "app_check_token_auto_refresh": false,
  "perf_collection_deactivated": false,
  "crashlytics_is_error_generation_on_js_crash_enabled": true,
  "messaging_ios_auto_register_for_remote_messages": false,
  "google_analytics_adid_collection_enabled": true,
  "crashlytics_ndk_enabled": true,
  "rnfirebase_json_testing_string": "abc",
  "analytics_idfv_collection_enabled": false,
  "rnfirebase_json_testing_boolean_false": false,
  "messaging_auto_init_enabled": false
}

which looks exactly like I expect

I'm out of time to look at this for the day but I've got local success here at least on intel mac + react-native 0.67 and in the github workflow environment, which allows inspection of every single thing + is 100% reproducible.

Somewhere in the difference between those environments and your environments is the problem. Wish I knew what it was

@dhruvasagar
Copy link

cocoapods is installed via homebrew and I have a separate ruby version manager (asdf). Would it help to use system ruby that ships with macos ? btw, I am on a macbook with the m1 max chip

@mikehardy
Copy link
Collaborator

I use rvm personally and ruby-3.1.2 currently, with cocoapods installed as a gem.
However, none of that should matter and there is an infinite variety - what I was getting at by pointing out our e2e environment is that we have a known good 100% reproducible environment with all known versions spec'ed out.

And it works. I have a different environment which also works (a couple actually, intel and m1). So the burden of proof is on reporters now to investigate differences as I can not reproduce and I've provided full spec for success reproduction, I'm not sure what else I can do

I cannot speculate on the infinite variety of possible dev environments though, that's inefficient use of time, right?

@lucas-cz
Copy link
Author

@mikehardy I agree, there must be an environment difference. I will check the environment you are referring and try to find something useful.

I can't find the Info.plist file that is generated after the build. The ./ios/build/Build/Products/Debug-iphonesimulator/testing.app/Info.plist path that you mentioned, is relative to the project's root folder?

I will check the situation for React Native 0.67 and post any useful results.

@mikehardy
Copy link
Collaborator

Yes - that path is from the root folder, but that's because we specify a build folder in our build for the app via command line, you may find it also in ~/Library/Developer/Xcode/DerivedData/something/something/etc

@lucas-cz
Copy link
Author

lucas-cz commented May 2, 2022

Yes - that path is from the root folder, but that's because we specify a build folder in our build for the app via command line, you may find it also in ~/Library/Developer/Xcode/DerivedData/something/something/etc

Thanks! I've found the Info.plist there. My firebase_json_raw value is:

<key>firebase_json_raw</key>
        <string>e30=</string>

Where e30= is decoded as {}.

Everything points to a problem reading the firebase.json file (maybe caused by some environment difference?). Thanks @mikehardy for all the information that you provided, it really helps me to debug this. I will keep trying to find de root of the problem and share any results.

By the way, I've tried the same test in React Native 0.67, with the same results:
Android (Debug and Release) and iOS (Release) working fine, but iOS (Debug) not sending reports.

@mikehardy
Copy link
Collaborator

definitely looks like firebase.json is not seen and thus not interpolated somehow. I believe our ruby script, which is in the app package, prints some information during it's execution, and the execution itself is happening from a cocoapod hook we use. Should be possible to instrument the script with some logging to see what's what I hope

@mikehardy
Copy link
Collaborator

mikehardy commented May 9, 2022

This may be related, but as I'm gearing up to handle the new SDKs releasing during Google I/O week here (firebase-ios-sdk v9, firebase-android-sdk v30) I started doing baseline testing and I think I have something related here.

I'm starting to see failures to see the config JSON in our e2e harness, but only on macOS 12, and only recently - it definitely used to work, I do check it semi-frequently. This is more difficult then the normal bug for us to reproduce because so much of our test infrastructures is still macOS 11 (github actions macos-latest is still 11 for instance as are most of my local machines for various reasons, I'm going to opt it in to macos-12 in a moment which will expose this)

  1) config
       json
         should read firebase.json data:
     TypeError: Cannot read properties of undefined (reading 'should')
      at Context.<anonymous> (/Users/mike/work/Invertase/react-native-firebase/packages/app/e2e/config.e2e.js:31:47)
      at runMicrotasks (<anonymous>)

I note the original reporter @lucas-cz is on macOS 12, so this may be reproduced. Is anyone seeing this on macOS 11 or is this all macOS 12?

@dhruvasagar
Copy link

@mikehardy I am on 12.3.1

@mikehardy
Copy link
Collaborator

Thanks for reporting @dhruvasagar

macOS 12.3 - released on March 24 - removed the python interpreter, python3 exists but our iOS config machinery relied on python existing:

_JSON_OUTPUT_BASE64=$(python -c 'import json,sys,base64;print(base64.b64encode(json.dumps(json.loads(open('"'${_SEARCH_RESULT}'"').read())['${_JSON_ROOT}'])))' || echo "e30=")

I traced the failure to that line. I can do a one-liner node base64 so that we don't need to rely on python, however that's actually problematic as the node binary is - unbelievably - not always available on the Xcode compile path (strange but true). python3 is though and my testing indicates python3 works with the same command line after some forward-porting from the python2 syntax.

PRs in flight for the fix and for the test-fix (to make sure our tests do fail on macOS12 and we see it, then they'll pass when the fix merges...)

@lucas-cz
Copy link
Author

That fixed it! I updated react-native-firebase to 14.9.2 and it's working now!
I can see all crash reports on Android/iOS for Debug and Release builds.

Thanks @mikehardy for the extensive support 😁.

@mikehardy
Copy link
Collaborator

So happy to hear that! Would you believe that even the macos-12 runner in github workflows includes a python binary (for convenience, which I do understand) so not even updating to macos-12 runner showed this. Only way to reproduce was to have a mostly stock macos 12.3+ machine and run the e2e harness. I've got a personal task to update more of my personal test infrastructure to have that, they're mostly macos11 VMs and I've been stuck on getting nested virt for android emus going in macos12 VMs. Just a tangle of things here making us blind to this. Glad it's nailed for now though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-triage Issue needs additional investigation/triaging. platform: ios plugin: crashlytics Firebase Crashlytics resolution: needs-repro This issue could not be reproduced or needs a repro provided. type: bug New bug report Workflow: Needs Review Pending feedback or review from a maintainer.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants