React-native-firebase: 馃敟馃敟 [Firebase/Core] Configuration failed in iOS

Created on 9 Jun 2020  路  16Comments  路  Source: invertase/react-native-firebase

Issue



I follow the guidelines for setting up firebase with crashlytics, Android works fine but iOS stuck on verifying firebase installation.
Screen Shot 2020-06-09 at 20 45 17

The crashlytics tabs on console correctly display crashes though
Screen Shot 2020-06-09 at 20 46 44

When I run the project from XCode it says

Setting up RNFirebase instance 2017-03-18 23:29:35.861 wishlizt[2927] <Error> [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure] to your application initialization

I found this old issue #10 but it seems the demo app is already gone

Triggering crash with this code

const testCrash = () => {
  console.log("Crashing...")
  crashlytics().log("Test Message!")
  crashlytics().recordError(new Error("Test Error!"))
  crashlytics().crash()
}

Project Files






Javascript

Click To Expand

#### `package.json`:

{
  "name": "bsq-mobile",
  "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 index.js app storybook test --fix --ext .js,.ts,.tsx",
    "compile": "tsc --noEmit -p . --pretty",
    "format": "npm-run-all format:*",
    "format:js": "prettier --write '**/*.js'",
    "format:json": "prettier --write '**/*.json'",
    "format:md": "prettier --write '**/*.md'",
    "format:ts": "prettier --write '**/*.ts{,x}'",
    "hack:types-react-navigation": "rimraf node_modules/@types/react-navigation/node_modules/@types",
    "hack:types-react-native": "rimraf node_modules/@types/react-native/node_modules/@types",
    "hack:types-react-test-renderer": "rimraf node_modules/@types/react-test-renderer/node_modules/@types",
    "patch": "patch-package",
    "postinstall": "node ./bin/postInstall",
    "prepare": "npm-run-all patch hack:*",
    "storybook": "start-storybook -p 9001 -c ./storybook",
    "adb": "adb reverse tcp:9090 tcp:9090 && adb reverse tcp:3000 tcp:3000 && adb reverse tcp:9001 tcp:9001 && adb reverse tcp:8081 tcp:8081"
  },
  "dependencies": {
    "@react-native-community/async-storage": "^1.9.0",
    "@react-native-community/masked-view": "0.1.5",
    "@react-native-firebase/app": "^7.2.0",
    "@react-native-firebase/crashlytics": "^7.1.4",
    "@react-navigation/native": "^5.1.5",
    "apisauce": "1.1.1",
    "i18n-js": "^3.0.11",
    "lodash.throttle": "4.1.1",
    "mobx": "^4.15.4",
    "mobx-react-lite": "^1.4.1",
    "mobx-state-tree": "^3.14.1",
    "ramda": "0.27.0",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-gesture-handler": "^1.5.0",
    "react-native-keychain": "5.0.1",
    "react-native-localize": "^1.0.0",
    "react-native-safe-area-context": "0.7.3",
    "react-native-safe-area-view": "1.0.0",
    "react-native-screens": "^2.5.0",
    "react-native-splash-screen": "3.2.0",
    "reactotron-mst": "^3.1.1",
    "reactotron-react-native": "^4.0.0-beta.1",
    "validate.js": "0.13.1"
  },
  "devDependencies": {
    "@babel/core": "^7.9.6",
    "@babel/plugin-proposal-decorators": "^7.0.0",
    "@babel/plugin-proposal-optional-catch-binding": "^7.0.0",
    "@babel/runtime": "^7.9.6",
    "@storybook/addon-storyshots": "5.3.17",
    "@storybook/react-native": "5.3.17",
    "@storybook/react-native-server": "5.3.17",
    "@types/jest": "25.1.4",
    "@types/ramda": "0.26.44",
    "@types/react": "16.9.23",
    "@types/react-native": "0.61.23",
    "@types/react-test-renderer": "16.9.2",
    "@typescript-eslint/eslint-plugin": "^2.24.0",
    "@typescript-eslint/parser": "^2.24.0",
    "babel-jest": "^26.0.1",
    "eslint": "^6.6.0",
    "eslint-config-prettier": "^6.0.0",
    "eslint-config-standard": "^14.1.0",
    "eslint-plugin-import": "^2.15.0",
    "eslint-plugin-node": "^11.0.0",
    "eslint-plugin-promise": "^4.0.1",
    "eslint-plugin-react": "^7.12.4",
    "eslint-plugin-react-native": "^3.6.0",
    "eslint-plugin-standard": "^4.0.0",
    "ignite-bowser": "^5.0.3",
    "jest": "^26.0.1",
    "jetifier": "^1.6.1",
    "metro-react-native-babel-preset": "^0.59.0",
    "npm-run-all": "4.1.5",
    "patch-package": "6.2.1",
    "postinstall-prepare": "1.0.1",
    "prettier": "1.19.1",
    "react-devtools-core": "4.5.0",
    "react-powerplug": "1.0.0",
    "react-test-renderer": "16.9.0",
    "rimraf": "3.0.2",
    "solidarity": "2.3.1",
    "typescript": "3.8.3"
  },
  "jest": {
    "preset": "react-native",
    "setupFiles": [
      "<rootDir>/node_modules/react-native/jest/setup.js",
      "<rootDir>/test/setup.ts"
    ],
    "testPathIgnorePatterns": [
      "/node_modules/",
      "/e2e"
    ],
    "transformIgnorePatterns": [
      "node_modules/(?!(jest-)?react-native|react-native|@react-navigation|@storybook|@react-native-community)"
    ]
  },
  "prettier": {
    "printWidth": 100,
    "semi": false,
    "singleQuote": false,
    "trailingComma": "all"
  },
  "eslintConfig": {
    "parser": "@typescript-eslint/parser",
    "extends": [
      "prettier",
      "plugin:@typescript-eslint/recommended",
      "plugin:react/recommended",
      "plugin:react-native/all",
      "standard"
    ],
    "parserOptions": {
      "ecmaFeatures": {
        "jsx": true
      },
      "project": "./tsconfig.json"
    },
    "plugins": [
      "@typescript-eslint",
      "react",
      "react-native"
    ],
    "settings": {
      "react": {
        "pragma": "React",
        "version": "detect"
      }
    },
    "globals": {
      "__DEV__": false,
      "jasmine": false,
      "beforeAll": false,
      "afterAll": false,
      "beforeEach": false,
      "afterEach": false,
      "test": false,
      "expect": false,
      "describe": false,
      "jest": false,
      "it": false
    },
    "rules": {
      "comma-dangle": 0,
      "no-unused-vars": 0,
      "no-undef": 0,
      "quotes": 0,
      "react/no-unescaped-entities": 0,
      "react/prop-types": "off",
      "react-native/no-raw-text": 0,
      "space-before-function-paren": 0,
      "@typescript-eslint/ban-ts-ignore": 0,
      "@typescript-eslint/indent": 0,
      "@typescript-eslint/explicit-member-accessibility": 0,
      "@typescript-eslint/explicit-function-return-type": 0,
      "@typescript-eslint/member-delimiter-style": 0,
      "@typescript-eslint/no-explicit-any": 0,
      "@typescript-eslint/no-object-literal-type-assertion": 0,
      "@typescript-eslint/no-empty-interface": 0,
      "@typescript-eslint/no-var-requires": 0
    }
  }
}
#### `firebase.json` for react-native-firebase v6:
{
  "react-native": {
    "crashlytics_debug_enabled": true
  }
}

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'BSQMobile' do
  # Pods for BSQMobile
  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'

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

  use_native_modules!
end

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

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

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 "AppDelegate.h"

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

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  if ([FIRApp defaultApp] == nil) {
    [FIRApp configure];
  }

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

  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  return YES;
}

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

@end


Android

Click To Expand

#### Have you converted to AndroidX? - [x] my application is an AndroidX application? - [x] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [x] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`:

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 19
        compileSdkVersion = 28
        targetSdkVersion = 28
    }
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.2")
        classpath("com.google.gms:google-services:4.2.0")
        classpath("io.fabric.tools:gradle:1.28.1")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}
#### `android/app/build.gradle`:
apply plugin: "com.android.application"
apply plugin: 'io.fabric'

import com.android.build.OutputFile

/**
 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
 * and bundleReleaseJsAndAssets).
 * These basically call `react-native bundle` with the correct arguments during the Android build
 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
 * bundle directly from the development server. Below you can see all the possible configurations
 * and their defaults. If you decide to add a configuration block, make sure to add it before the
 * `apply from: "../../node_modules/react-native/react.gradle"` line.
 *
 * project.ext.react = [
 *   // the name of the generated asset file containing your JS bundle
 *   bundleAssetName: "index.android.bundle",
 *
 *   // the entry file for bundle generation
 *   entryFile: "index.android.js",
 *
 *   // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
 *   bundleCommand: "ram-bundle",
 *
 *   // whether to bundle JS and assets in debug mode
 *   bundleInDebug: false,
 *
 *   // whether to bundle JS and assets in release mode
 *   bundleInRelease: true,
 *
 *   // whether to bundle JS and assets in another build variant (if configured).
 *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
 *   // The configuration property can be in the following formats
 *   //         'bundleIn${productFlavor}${buildType}'
 *   //         'bundleIn${buildType}'
 *   // bundleInFreeDebug: true,
 *   // bundleInPaidRelease: true,
 *   // bundleInBeta: true,
 *
 *   // whether to disable dev mode in custom build variants (by default only disabled in release)
 *   // for example: to disable dev mode in the staging build type (if configured)
 *   devDisabledInStaging: true,
 *   // The configuration property can be in the following formats
 *   //         'devDisabledIn${productFlavor}${buildType}'
 *   //         'devDisabledIn${buildType}'
 *
 *   // the root of your project, i.e. where "package.json" lives
 *   root: "../../",
 *
 *   // where to put the JS bundle asset in debug mode
 *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
 *
 *   // where to put the JS bundle asset in release mode
 *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in debug mode
 *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in release mode
 *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
 *
 *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
 *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
 *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
 *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
 *   // for example, you might want to remove it from here.
 *   inputExcludes: ["android/**", "ios/**"],
 *
 *   // override which node gets called and with what additional arguments
 *   nodeExecutableAndArgs: ["node"],
 *
 *   // supply additional arguments to the packager
 *   extraPackagerArgs: []
 * ]
 */

project.ext.react = [
    entryFile: "index.js",
    enableHermes: false,  // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

/**
 * The preferred build flavor of JavaScriptCore.
 *
 * For example, to use the international variant, you can use:
 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
 *
 * The international variant includes ICU i18n library and necessary data
 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
 * give correct results when using with locales other than en-US.  Note that
 * this variant is about 6MiB larger per architecture than default.
 */
def jscFlavor = 'org.webkit:android-jsc:+'

/**
 * Whether to enable the Hermes VM.
 *
 * This should be set on project.ext.react and mirrored here.  If it is not set
 * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
 * and the benefits of using Hermes will therefore be sharply reduced.
 */
def enableHermes = project.ext.react.get("enableHermes", false);

def dateTime = new Date().format('yyyyMMdd.HHmmss')

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.example"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0.0"
        archivesBaseName = "$dateTime-$applicationId-v$versionName($versionCode)"
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply plugin: 'com.google.gms.google-services'
#### `android/settings.gradle`:
rootProject.name = 'BSQMobile'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
#### `MainApplication.java`:
package com.example;

import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost =
      new ReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
          return BuildConfig.DEBUG;
        }

        @Override
        protected List<ReactPackage> getPackages() {
          @SuppressWarnings("UnnecessaryLocalVariable")
          List<ReactPackage> packages = new PackageList(this).getPackages();
          // Packages that cannot be autolinked yet can be added manually here, for example:
          // packages.add(new MyReactNativePackage());
          return packages;
        }

        @Override
        protected String getJSMainModuleName() {
          return "index";
        }
      };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
    initializeFlipper(this); // Remove this line if you don't want Flipper enabled
  }

  /**
   * Loads Flipper in React Native templates.
   *
   * @param context
   */
  private static void initializeFlipper(Context context) {
    if (BuildConfig.DEBUG) {
      try {
        /*
         We use reflection here to pick up the class that initializes Flipper,
        since Flipper library is not available in release mode
        */
        Class<?> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
        aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
      } catch (ClassNotFoundException e) {
        e.printStackTrace();
      } catch (NoSuchMethodException e) {
        e.printStackTrace();
      } catch (IllegalAccessException e) {
        e.printStackTrace();
      } catch (InvocationTargetException e) {
        e.printStackTrace();
      }
    }
  }
}
#### `AndroidManifest.xml`:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>


Environment

Click To Expand

**`react-native info` output:**

System:
    OS: macOS 10.15.5
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 57.03 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.17.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-19 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    create-react-native-app: 3.3.0
    create-react-native-module: 0.19.0
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7
- **Platform that you're experiencing the issue on**: - [x] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`@react-native-firebase/app` version you're using that has this issue:** - `^7.2.0` - **`@react-native-firebase/crashlytics` version you're using that has this issue:** - `^7.1.4` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y` & `3.8.3`




Most helpful comment

This is the instructions provided by the console during app registration.

# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods

That鈥檚 what triggered me to realise analytics was a factor. Also realised you don鈥檛 need core to use analytics.

I don鈥檛 think the SDK has any reference to the registration process. I鈥檒l make a issue and hopefully they can make the verification step clearer. Hopefully this helps you close a few issues related to RN users trying to setup firebase and think they doing something wrong.

I鈥檒l look at a PR for docs here as well.

All 16 comments

Strange. I see the configure line there in AppDelegate.m
npx react-native-clean-project and retry perhaps?

Also unless you have debugging turned on for crashlytics and then do a crash on purpose it won't communicate, and even then unless you send the dSYMs manually it probably won't have them (https://stackoverflow.com/questions/54577202/how-to-run-upload-symbols-to-upload-dsyms-as-a-part-of-xcode-build-process/55796619#55796619) and even then you'll need to make sure to restart the app after the crash or it won't send etc etc

It does work though, this will in the end be a problem with your local project and how you're using crashlytics, which sounds unfriendly but is not intended that way - just focuses on where to look for the issue

What strange is, I DO get the crash report, but failed to finish firebase installation verification process, hence don't have any data aside from the crash report

I think it's not missing dSYMs problem and as a matter of fact, it's not even crashlytics problem

I'll try to set up another project using basic react native and with the boilerplate I'm currently using (https://github.com/infinitered/ignite-bowser)

can always give a look to https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-v6.sh for throwaway example

I have tried some projects, but stills failed on me

npx react-native-clean-project

  • on my existing project still not working

npx react-native init AwesomeProject

  • firebase app
  • android -> installation not verified
  • ios -> installation not verified

npx react-native init AwesomeProject

  • firebase app + crashlytics
  • android -> installation not verified
  • ios -> installation not verified

ignite new MyApp -b bowser (using ignite boilerplate)

  • firebase app
  • android -> installation verified
  • ios -> installation not verified

last but not least, using your throwaway example script

  • firebase app
  • android -> installation verified
  • ios -> installation not verified
    Note
  • Follow set up document from https://rnfirebase.io/ and https://rnfirebase.io/crashlytics/usage
  • run on both ios and android simulator via react-native run-<platform>
  • Error [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured shows in all project if I run in XCode

Let me verify that crashes are reported successfully for iOS

Please define exactly what you mean by "working instantly" and "not working" - do you mean the firebase console saying it is integrated?

I must admit I'm not interested in that much. I am very interested if "working instantly" vs "not working" means "I added a 'crash now' button to my app, turned on debug crash reporting, verified my dSYMs were uploaded, triggered a crash, reopened my app, and the crash was not reported". That's what I am going to test - actual success reporting a crash

Sorry for the bad choice of words, I already updated my comment

During firebase installation verification process (image in issue desc), verified means apps connected (or integrated) to firebase dashboard and can do bunch of features like retention etc, and the loading bar will immediately change to success

For installation not verified, verification process takes forever

My requirement actually just reporting a crash, as long as the console can show crash report (which already did), I'm fine with it

I'm opening this issue just out of curiosity because I haven't use firebase that extensively to involve all its features. I don't really know whether this problem will affect other firebase features aside from crash reporting

If it's reporting crashes correctly, whether the console verifies or not is immaterial I think. It is not a great developer experience and could perhaps use a documentation note here (PR's happily accepted!) but that's more about the console reporting. Might be worth logging an upstream bug with them

@mikehardy I've opened a similar issue previously and now I noticed that even the auth module is working without connecting app to Firebase services. So this is RNFirebase or Firebase issue, what do you think?

Firebase issue, to me. There is no way the "auth module is working" unless it is "connecting app to Firebase services", so if it is connecting (because if not it would not be working!?) then why isn't their little setup "we are trying to help you get set up" indicator working? No idea

Digging deeper into this...

Assuming you have the following in your AppDelegate.m:

if ([FIRApp defaultApp] == nil) {
    [FIRApp configure];
}

It looks like calling [FIRApp defaultApp] when the app is not configured throws the error you see.
https://github.com/firebase/firebase-ios-sdk/blob/6d08f1034ff9fe3eb1510e8181c6377747d5e44f/FirebaseCore/Sources/FIRApp.m#L245

It then will continue to configure the app successfully afterwards. I've removed the defaultApp check and now following google's recommendation and calling [FIRApp configure] directly. Until they make isDefaultAppConfigured a public method.

With regards to the console verification, I found as soon as I added @react-native-firebase/analytics, the app verified.

But I could be completely wrong...

Very interesting report about console verification working when you add the analytics package. That intuitively explain (or causes me to have confirmation bias, take your pick) that more people are excluding analytics (privacy concerns, also it's more possible) but it's relatively new that you can really disentangle all that stuff on the Google side, so perhaps their console doesn't handle it well yet.

This definitely seems like an upstream issue to me. They may not be able to tell without analytics integrated, but there should be a note on the console during verification saying as much ("if you have not opted to use analytics, the console will not automatically verify your app is connected, you may proceed to the console...")

@mikehardy Tracked down confirmation from the horse鈥檚 mouth. https://github.com/firebase/firebase-ios-sdk/issues/2838#issuecomment-483849251

Mmm - they've known about it for a while, if there is some place in react-native-firebase docs that specifically prompts people that they should be expecting this - or where ever it is where the docs hand people off to look at the console it might help a lot of people if you did a quick PR mentioning without analytics things will work but they will never see confirmation, and a link to that comment (which is gold, great find)

This is the instructions provided by the console during app registration.

# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods

That鈥檚 what triggered me to realise analytics was a factor. Also realised you don鈥檛 need core to use analytics.

I don鈥檛 think the SDK has any reference to the registration process. I鈥檒l make a issue and hopefully they can make the verification step clearer. Hopefully this helps you close a few issues related to RN users trying to setup firebase and think they doing something wrong.

I鈥檒l look at a PR for docs here as well.

@cloudratha you were right, after installing and including analytics in the project, an app was successfully registered

Was this page helpful?
0 / 5 - 0 ratings

Related issues

n-scope picture n-scope  路  3Comments

Damnum picture Damnum  路  3Comments

jonaseck2 picture jonaseck2  路  3Comments

Draccan picture Draccan  路  3Comments

dgruseck picture dgruseck  路  3Comments