invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.67k stars 2.21k forks source link

🔥 [🐛] Why Crashlytics does not report when crash due to CSS error ? #6747

Closed GautierAnd closed 1 year ago

GautierAnd commented 1 year ago

Issue

Hi everybody,

On Android TV (not tested on tvOS), if i write an error in the CSS of my code, the app crashes. And with this particular case, the report to crashlytics is not sent. I tried with others crashes like react native crashlytics crash test crashlytics().crash(), throw error throw Error("I'm an error"); or display non-existent key <Text>{test.crash}</Text> and reports are always sent correctly.

Steps to reproduce

FYI, this is the error stack generated on Android:

java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:117)
        at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:161)
        at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:65)
        at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:320)
        at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:261)
        at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:505)
        at com.facebook.react.uimanager.ReanimatedUIManager.createView(ReanimatedUIManager.java:72)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loop(Looper.java:209)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
        at java.lang.Thread.run(Thread.java:914)
     Caused by: java.lang.IllegalArgumentException: Unknown value: calc(100% - 960)
        at com.facebook.react.uimanager.LayoutShadowNode$MutableYogaValue.setFromDynamic(LayoutShadowNode.java:63)
        at com.facebook.react.uimanager.LayoutShadowNode.setHeight(LayoutShadowNode.java:154)
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:117) 
        at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:161) 
        at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:65) 
        at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:320) 
        at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:261) 
        at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:505) 
        at com.facebook.react.uimanager.ReanimatedUIManager.createView(ReanimatedUIManager.java:72) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372) 
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188) 
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:873) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) 
        at android.os.Looper.loop(Looper.java:209) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228) 
        at java.lang.Thread.run(Thread.java:914) 
D/EventLogger: isPlaying [eventTime=10.68, mediaPos=7.81, window=0, period=0, false]
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 25413 (mqt_native_modu), pid 25365 (r.rio.tv)

Do you know why Crashlytics reports are never sent with this type of error ?

Thank in advance, Gautier.


Project Files

Javascript

Click To Expand

#### `package.json`: ```json { "name": "rio-tv-rn", "version": "2.0.1", "private": true, "scripts": { "get-version": "yarn version --non-interactive | grep Current | cut -d ' ' -f 4", "prepare": "husky install", "postinstall": "yarn patch-package && export APP_VERSION=$(yarn -s get-version) && cd ./node_modules/@rio/rio-common && yarn generate-extra-env", "start": "react-native start", "test": "jest", "codegen": "DEBUG=1 graphql-codegen", "lint": "eslint src -c .eslintrc.js --ext .js,.jsx,.ts,.tsx --max-warnings 0", "lint-fix": "eslint src -c .eslintrc.js --ext .js,.jsx,.ts,.tsx --fix", }, "resolutions": { "@apollo/client": "~3.4.0", "@react-navigation/drawer": "rio/react-navigation.git#react-navigation-drawer-v6.5.1-gitpkg", "@react-navigation/routers": "rio/react-navigation.git#react-navigation-routers-v6.1.3-gitpkg" }, "dependencies": { "@apollo/client": "~3.4.0", "@react-native-async-storage/async-storage": "^1.17.10", "@react-native-community/blur": "^4.2.0", "@react-native-firebase/app": "^16.4.6", "@react-native-firebase/crashlytics": "^16.4.6", "@react-navigation/drawer": "rio/react-navigation.git#react-navigation-drawer-v6.5.1-gitpkg", "@react-navigation/native": "^6.0.13", "@react-navigation/native-stack": "^6.9.0", "@react-navigation/routers": "rio/react-navigation.git#react-navigation-routers-v6.1.3-gitpkg", "@react-navigation/stack": "^6.3.1", "@reduxjs/toolkit": "^1.8.1", "@shopify/flash-list": "^1.4.0", "@rio/rio-common": "1.45.0", "@rio/rio-shared": "0.97.0", "graphql": "^15", "i18next": "^21.8.0", "jwt-decode": "^3.1.2", "lodash": "^4.17.21", "lottie-ios": "^3.2.3", "lottie-react-native": "^5.0.1", "react": "17.0.2", "react-i18next": "^11.16.9", "react-native": "^0.68.2", "react-native-default-preference": "^1.4.4", "react-native-device-info": "^8.7.1", "react-native-drop-shadow": "^0.0.6", "react-native-encrypted-storage": "^4.0.3", "react-native-gesture-handler": "~2.4.2", "react-native-linear-gradient": "^2.6.2", "react-native-qrcode-svg": "^6.1.2", "react-native-reanimated": "~2.8.0", "react-native-safe-area-context": "^4.2.5", "react-native-screens": "^3.18.2", "react-native-sound": "^0.11.2", "react-native-svg": "^13.4.0", "react-native-vector-icons": "^9.1.0", "react-redux": "^8.0.1", "redux-logger": "^3.0.6", "redux-persist": "^6.0.0" }, "devDependencies": { "@babel/core": "^7.17.9", "@babel/runtime": "^7.17.9", "@commitlint/cli": "^16.2.3", "@commitlint/config-conventional": "^16.2.1", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.1", "@graphql-codegen/fragment-matcher": "^3.1.0", "@graphql-codegen/introspection": "^2.0.0", "@graphql-codegen/plugin-helpers": "^2.4.2", "@graphql-codegen/typescript": "^2.0.0", "@graphql-codegen/typescript-operations": "^2.0.1", "@rio/eslint-config-rio-react": "1.5.0", "@rio/prettier-config-rio": "1.2.0", "@types/lodash": "^4.14.182", "@types/react": "^18.0.5", "@types/react-native": "0.67.6", "@types/react-native-vector-icons": "^6.4.10", "@types/react-redux": "^7.1.24", "@types/redux-logger": "^3.0.9", "@typescript-eslint/eslint-plugin": "^5.15.0", "@typescript-eslint/parser": "^5.15.0", "@welldone-software/why-did-you-render": "^7.0.1", "babel-jest": "^27.5.1", "babel-plugin-transform-remove-console": "^6.9.4", "eslint": "^8.11.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-typescript": "^16.1.3", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-node": "^0.3.6", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.29.4", "eslint-plugin-react-hooks": "^4.3.0", "husky": "^7.0.4", "jest": "^27.5.1", "metro-react-native-babel-preset": "^0.70.1", "patch-package": "^6.4.7", "postinstall-postinstall": "^2.1.0", "prettier": "^2.6.0", "react-test-renderer": "17.0.2", "typescript": "~4.5.5" }, "jest": { "preset": "react-native" } } ``` #### `firebase.json` for react-native-firebase v6: ```json { "react-native": { "crashlytics_debug_enabled": false } } ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # N/A ``` #### `AppDelegate.m`: ```objc // N/A ```


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`: ```groovy import org.apache.tools.ant.taskdefs.condition.Os // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = "31.0.0" minSdkVersion = 21 compileSdkVersion = 31 targetSdkVersion = 31 kotlinVersion = "1.5.31" // Or any version above 1.4.x RNNKotlinVersion = kotlinVersion if (System.properties['os.arch'] == "aarch64") { // For M1 Users we need to use the NDK 24 which added support for aarch64 ndkVersion = "24.0.8215888" } else if (Os.isFamily(Os.FAMILY_WINDOWS)) { // For Android Users, we need to use NDK 23, otherwise the build will // fail due to paths longer than the OS limit ndkVersion = "23.1.7779620" } else { // Otherwise we default to the side-by-side NDK version from AGP. ndkVersion = "21.4.7075529" } } repositories { google() mavenLocal() mavenCentral() } dependencies { classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") classpath("com.android.tools.build:gradle:7.0.4") classpath("com.facebook.react:react-native-gradle-plugin") classpath("de.undercouch:gradle-download-task:4.1.2") classpath 'com.google.gms:google-services:4.3.13' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenLocal() mavenCentral() 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") } mavenCentral { // We don't want to fetch react-native from Maven Central as there are // older versions over there. content { excludeGroup "com.facebook.react" } } google() maven { url 'https://www.jitpack.io' } } } ``` #### `android/app/build.gradle`: ```groovy plugins { id 'com.android.application' id 'com.google.gms.google-services' id 'com.google.firebase.crashlytics' } apply plugin: "com.android.application" import com.android.build.OutputFile import org.apache.tools.ant.taskdefs.condition.Os project.ext.react = [ enableHermes: true, // clean and rebuild if changing ] apply from: "../../node_modules/react-native/react.gradle" def enableSeparateBuildPerCPUArchitecture = false def enableProguardInReleaseBuilds = false def jscFlavor = 'org.webkit:android-jsc:+' def enableHermes = project.ext.react.get("enableHermes", false); def reactNativeArchitectures() { def value = project.getProperties().get("reactNativeArchitectures") return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } android { ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion defaultConfig { applicationId "ch.rio.tv" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode System.env.BUILD_NUMBER as Integer ?: 1 versionName System.env.npm_package_version ?: "2.0.0" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { // We configure the NDK build only if you decide to opt-in for the New Architecture. externalNativeBuild { ndkBuild { arguments "APP_PLATFORM=android-21", "APP_STL=c++_shared", "NDK_TOOLCHAIN_VERSION=clang", "GENERATED_SRC_DIR=$buildDir/generated/source", "PROJECT_BUILD_DIR=$buildDir", "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build" cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1" cppFlags "-std=c++17" // Make sure this target name is the same you specify inside the // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable. targets "rio_appmodules" // Fix for windows limit on number of character in file paths and in command lines if (Os.isFamily(Os.FAMILY_WINDOWS)) { arguments "NDK_OUT=${rootProject.projectDir.getParent()}\\.cxx", "NDK_APP_SHORT_COMMANDS=true" } } } if (!enableSeparateBuildPerCPUArchitecture) { ndk { abiFilters (*reactNativeArchitectures()) } } } } if (isNewArchitectureEnabled()) { // We configure the NDK build only if you decide to opt-in for the New Architecture. externalNativeBuild { ndkBuild { path "$projectDir/src/main/jni/Android.mk" } } def reactAndroidProjectDir = project(':ReactAndroid').projectDir def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") into("$buildDir/react-ndk/exported") } def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") into("$buildDir/react-ndk/exported") } afterEvaluate { // If you wish to add a custom TurboModule or component locally, // you should uncomment this line. // preBuild.dependsOn("generateCodegenArtifactsFromSchema") preDebugBuild.dependsOn(packageReactNdkDebugLibs) preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) // Due to a bug inside AGP, we have to explicitly set a dependency // between configureNdkBuild* tasks and the preBuild tasks. // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 configureNdkBuildRelease.dependsOn(preReleaseBuild) configureNdkBuildDebug.dependsOn(preDebugBuild) reactNativeArchitectures().each { architecture -> tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure { dependsOn("preDebugBuild") } tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure { dependsOn("preReleaseBuild") } } } } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include (*reactNativeArchitectures()) } } signingConfigs { debug { } release { } } buildTypes { debug { signingConfig signingConfigs.debug } release { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.release 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 // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 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 = defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } } } configurations.all { resolutionStrategy { force 'com.facebook.react:react-native:0.68.2-7' } } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { exclude group:'com.facebook.fbjni' } debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' exclude group:'com.squareup.okhttp3', module:'okhttp' } debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' } if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; debugImplementation files(hermesPath + "hermes-debug.aar") releaseImplementation files(hermesPath + "hermes-release.aar") } else { implementation jscFlavor } implementation platform('com.google.firebase:firebase-bom:31.1.0') implementation 'com.google.firebase:firebase-crashlytics' } if (isNewArchitectureEnabled()) { // If new architecture is enabled, we let you build RN from source // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. // This will be applied to all the imported transtitive dependency. configurations.all { resolutionStrategy.dependencySubstitution { substitute(module("com.facebook.react:react-native")) .using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source") } } } // 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.implementation into 'libs' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) def isNewArchitectureEnabled() { // To opt-in for the New Architecture, you can either: // - Set `newArchEnabled` to true inside the `gradle.properties` file // - Invoke gradle with `-newArchEnabled=true` // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" } project.ext.vectoricons = [ iconFontNames: [''] ] apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" ``` #### `android/settings.gradle`: ```groovy rootProject.name = 'Rio' include ':react-native-sound' project(':react-native-sound').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sound/android') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' includeBuild('../node_modules/react-native-gradle-plugin') if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { include(":ReactAndroid") project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') } ``` #### `MainApplication.java`: ```java package ch.rio.tv; import android.app.Application; import android.content.Context; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.config.ReactFeatureFlags; import com.facebook.soloader.SoLoader; import ch.rio.tv.BuildConfig; import ch.rio.tv.newarchitecture.MainApplicationReactNativeHost; 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 getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List 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"; } }; private final ReactNativeHost mNewArchitectureNativeHost = new MainApplicationReactNativeHost(this); @Override public ReactNativeHost getReactNativeHost() { if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { return mNewArchitectureNativeHost; } else { return mReactNativeHost; } } @Override public void onCreate() { super.onCreate(); // If you opted-in for the New Architecture, we enable the TurboModule system ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; SoLoader.init(this, /* native exopackage */ false); // Normally we only send key up events in ReactAndroidHWInputDeviceHelper // Change enableKeyDownEvents to true to send both key down and key up events ReactFeatureFlags.enableKeyDownEvents = true; // Disable Flipper since tvOS doesn't support it yet. // initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } /** * Loads Flipper in React Native templates. Call this in the onCreate method with something like * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); * * @param context * @param reactInstanceManager */ private static void initializeFlipper( Context context, ReactInstanceManager reactInstanceManager) { 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("ch.rio.tv.ReactNativeFlipper"); aClass .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) .invoke(null, context, reactInstanceManager); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } } ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` System: OS: macOS 12.3.1 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 126.04 MB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm Watchman: 2022.06.13.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 16, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 Build Tools: 28.0.1, 28.0.3, 29.0.1, 30.0.2, 31.0.0 System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google TV Intel x86 Atom, android-Q | Android TV Intel x86 Atom Android NDK: 21.4.7075529 IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: 1.8.0_221 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found @sebastien_rts/react-native-tvos: 0.68.2-7-15 react: 17.0.2 => 17.0.2 react-native: Not Found react-native-macos: Not Found npmGlobalPackages: ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [x] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `^16.4.6` - **`Firebase` module(s) you're using that has the issue:** - `Crashlytics` - **Are you using `TypeScript`?** - `Y` & `~4.5.5`


mikehardy commented 1 year ago

Hi there!

It is a shame that you opted to ignore the template, it could have saved some time by allowing you to access help:

firebase.json for react-native-firebase v6:
# N/A

https://stackoverflow.com/help/how-to-ask

You'll want to read this in order to configure things well and so you know how to verify they are configured well: https://invertase.io/blog/react-native-firebase-crashlytics-configuration

In the absence of information needed to help and with the idea the configuration guide above should get you there I'll close this as un-actionable

If you follow that guide and provide details to reproduce the problem we can revisit

GautierAnd commented 1 year ago

Hi again @mikehardy, I've updated my issue with the most information I could to complete the pattern. And I've added steps to reproduce the bug. If it is OK for you, could you re-open the issue please ?

mikehardy commented 1 year ago

Your firebase.json does not seem to follow the guide here https://invertase.io/blog/react-native-firebase-crashlytics-configuration - I expect something more like

{
  "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
  }
}

Please confirm you have followed that guide, made those changes, rebuilt the app, re-tested it watching adb logcat as instructed (that is, adb logcat | grep -i crash) and describe what you saw

GautierAnd commented 1 year ago

Thank for the feedback, I've fixed my firebase.json. I followed the guide and everything went well. I've correctly received the crash report after I clicked on the button with undefinedVariable.notAFunction(); code.

After this, I tried to connect logcat with my CSS crash and this is what I got. Before the crash

11-30 11:22:35.059  7822  7822 D FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
11-30 11:22:45.943  7874  7874 I FirebaseCrashlytics: Initializing Firebase Crashlytics 18.3.2 for ch.srgssr.playsuisse.tv
11-30 11:22:46.045  7874  7874 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBJSON: true
11-30 11:22:46.045  7874  7874 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: true
11-30 11:22:46.045  7874  7874 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true
11-30 11:22:46.045  7874  7906 D libcrashlytics: Initializing libcrashlytics version 3.2.0
11-30 11:22:46.048  7874  7874 I RNFBCrashlyticsInit: initialization successful
11-30 11:22:46.054  7874  7906 D libcrashlytics: Initializing native crash handling successful.
11-30 11:22:54.889  7874  7963 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBJSON: true
11-30 11:22:54.889  7874  7963 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: true
11-30 11:22:54.889  7874  7963 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true
11-30 11:22:54.889  7874  7963 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled via RNFBJSON: true
11-30 11:22:54.889  7874  7963 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled final value: true
11-30 11:22:54.889  7874  7963 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled via RNFBJSON: true
11-30 11:22:54.889  7874  7963 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled final value: true
11-30 11:23:29.013  8941  8941 D AndroidRuntime: Calling main entry org.chromium.components.crash.browser.CrashpadMain
11-30 11:23:29.888  9012  9012 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
11-30 11:23:29.894  1745  1745 I /system/bin/tombstoned: received crash request for pid 7964
11-30 11:23:29.905  9012  9012 I crash_dump32: performing dump of process 7874 (target tid = 7964)
11-30 11:23:30.046  9012  9012 W crash_dump32: type=1400 audit(0.0:3313): avc: denied { read } for name="u:object_r:hwservicemanager_prop:s0" dev="tmpfs" ino=7273 scontext=u:r:crash_dump:s0:c60,c256,c512,c768 tcontext=u:object_r:hwservicemanager_prop:s0 tclass=file permissive=0 app=ch.srgssr.playsuisse.tv

After the crash

11-30 11:25:29.851  9134  9134 I FirebaseCrashlytics: Initializing Firebase Crashlytics 18.3.2 for ch.srgssr.playsuisse.tv
11-30 11:25:29.986  9134  9134 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBJSON: true
11-30 11:25:29.986  9134  9134 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: true
11-30 11:25:29.986  9134  9134 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true
11-30 11:25:29.988  9134  9134 I RNFBCrashlyticsInit: initialization successful
11-30 11:25:29.994  9134  9171 D libcrashlytics: Initializing libcrashlytics version 3.2.0
11-30 11:25:30.004  9134  9171 D libcrashlytics: Initializing native crash handling successful.
11-30 11:25:38.784  9134  9231 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBJSON: true
11-30 11:25:38.785  9134  9231 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled after checking crashlytics_debug_enabled: true
11-30 11:25:38.785  9134  9231 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true
11-30 11:25:38.785  9134  9231 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled via RNFBJSON: true
11-30 11:25:38.785  9134  9231 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled final value: true
11-30 11:25:38.785  9134  9231 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled via RNFBJSON: true
11-30 11:25:38.785  9134  9231 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled final value: true

And still no report received...

mikehardy commented 1 year ago

Fascinating - looks like the configuration is good now and you've got crashes coming through in all other ways - I wonder if for this you need the ndk stuff installed.

There is actually a mention that it is needed for Yoga layout engine issues, which seems to be the case here? https://rnfirebase.io/crashlytics/usage#crashlytics-ndk

You may already have the crashes but they are hidden on the web console behind a "missing symbols" filter or something. Or if not:

Instructions from upstream: https://firebase.google.com/docs/crashlytics/ndk-reports

This should be automatic though, strange it is not catching a yoga issue. Unfortunately in my configuration logging (used for positive verification things are configured) I am not logging out the final status of the NDK crash upload but it defaults to true and you are not overriding it.

I was not able to find any previous issues that shows NDK reports were not going through so I'm currently fixated on those configuration blocks for symbol upload in android/app/build.gradle

mikehardy commented 1 year ago

6749 is a PR to update the docs a bit, the link for NDK config was stale and need to upload symbols was not noted

GautierAnd commented 1 year ago

I've enabled NDK reporting (https://rnfirebase.io/crashlytics/android-setup#4-optional-enable-crashlytics-ndk-reporting) And I reproduced the "CSS crash" in release variant. Unfortunately, I still don't receive report.

Here is adb logcat | grep -i crash logs Before crash

11-30 11:52:09.123 12047 12047 I FirebaseCrashlytics: Initializing Firebase Crashlytics 18.3.2 for ch.srgssr.playsuisse.tv
11-30 11:52:09.243 12047 12047 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBMeta: true
11-30 11:52:09.243 12047 12047 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true
11-30 11:52:09.243 12047 12047 I RNFBCrashlyticsInit: initialization successful
11-30 11:52:09.249 12047 12080 D libcrashlytics: Initializing libcrashlytics version 3.2.0
11-30 11:52:09.267 12047 12080 D libcrashlytics: Initializing native crash handling successful.
11-30 11:52:09.308 12047 12047 D ApkSoSource: not allowing consideration of lib/x86/libcrashlytics-common.so: deferring to libdir
11-30 11:52:09.309 12047 12047 D ApkSoSource: not allowing consideration of lib/x86/libcrashlytics-handler.so: deferring to libdir
11-30 11:52:09.309 12047 12047 D ApkSoSource: not allowing consideration of lib/x86/libcrashlytics-trampoline.so: deferring to libdir
11-30 11:52:09.309 12047 12047 D ApkSoSource: not allowing consideration of lib/x86/libcrashlytics.so: deferring to libdir
11-30 11:52:10.110 12047 12047 E chromium: [ERROR:filesystem_posix.cc(89)] stat /data/user/0/ch.srgssr.playsuisse.tv/cache/WebView/Crashpad: No such file or directory (2)
11-30 11:52:10.110 12047 12047 E chromium: [ERROR:filesystem_posix.cc(62)] mkdir /data/user/0/ch.srgssr.playsuisse.tv/cache/WebView/Crashpad: No such file or directory (2)
11-30 11:52:10.952 12047 12138 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBMeta: true
11-30 11:52:10.952 12047 12138 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true
11-30 11:52:10.953 12047 12138 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled via RNFBMeta: true
11-30 11:52:10.953 12047 12138 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled final value: true
11-30 11:52:10.956 12047 12138 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled via RNFBMeta: true
11-30 11:52:10.956 12047 12138 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled final value: true
11-30 11:53:33.444 13185 13185 D AndroidRuntime: Calling main entry org.chromium.components.crash.browser.CrashpadMain
11-30 11:53:33.890 13227 13227 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
11-30 11:53:33.891  1745  1745 I /system/bin/tombstoned: received crash request for pid 12139
11-30 11:53:33.892 13227 13227 I crash_dump32: performing dump of process 12047 (target tid = 12139)

After crash

11-30 11:56:08.685 13299 13299 I FirebaseCrashlytics: Initializing Firebase Crashlytics 18.3.2 for ch.srgssr.playsuisse.tv
11-30 11:56:08.743 13299 13331 D libcrashlytics: Initializing libcrashlytics version 3.2.0
11-30 11:56:08.749 13299 13299 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBMeta: true
11-30 11:56:08.749 13299 13299 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true
11-30 11:56:08.756 13299 13299 I RNFBCrashlyticsInit: initialization successful
11-30 11:56:08.760 13299 13331 D libcrashlytics: Initializing native crash handling successful.
11-30 11:56:10.750 13299 13373 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled via RNFBMeta: true
11-30 11:56:10.750 13299 13373 D RNFBCrashlyticsInit: isCrashlyticsCollectionEnabled final value: true
11-30 11:56:10.751 13299 13373 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled via RNFBMeta: true
11-30 11:56:10.751 13299 13373 D RNFBCrashlyticsInit: isErrorGenerationOnJSCrashEnabled final value: true
11-30 11:56:10.753 13299 13373 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled via RNFBMeta: true
11-30 11:56:10.753 13299 13373 D RNFBCrashlyticsInit: isCrashlyticsJavascriptExceptionHandlerChainingEnabled final value: true