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

[🐛] App crashing on bundle reload [Android] on react-native 0.73 #8159

Closed
4 of 10 tasks
HyzamAli opened this issue Nov 24, 2024 · 4 comments · Fixed by #8160
Closed
4 of 10 tasks

[🐛] App crashing on bundle reload [Android] on react-native 0.73 #8159

HyzamAli opened this issue Nov 24, 2024 · 4 comments · Fixed by #8160
Labels
resolution: fixed A fix has been merged into main. type: bug New bug report

Comments

@HyzamAli
Copy link

HyzamAli commented Nov 24, 2024

Issue

I just linked the react native firebase library with my app for enabling PNS using FCM. I did all the hardwiring and FCM is working as expected on both iOS and android. The issue however is that, on hot reload (by pressing 'R'), the app crashes in android with the following stack trace

FATAL EXCEPTION: mqt_native_modules
                                                                                                    Process: com.dividemobile, PID: 28320
                                                                                                    java.lang.StackOverflowError: stack size 1039KB
                                                                                                    	at io.invertase.firebase.common.ReactNativeFirebaseModule.invalidate(ReactNativeFirebaseModule.java:114)
                                                                                                    	at io.invertase.firebase.common.ReactNativeFirebaseModule.onCatalystInstanceDestroy(ReactNativeFirebaseModule.java:106)
                                                                                                    	at com.facebook.react.bridge.BaseJavaModule.invalidate(BaseJavaModule.java:71)
                                                                                                    	at io.invertase.firebase.common.ReactNativeFirebaseModule.invalidate(ReactNativeFirebaseModule.java:114)
                                                                                                    	at io.invertase.firebase.common.ReactNativeFirebaseModule.onCatalystInstanceDestroy(ReactNativeFirebaseModule.java:106)
                                                                                                    	at com.facebook.react.bridge.BaseJavaModule.invalidate(BaseJavaModule.java:71)
                                                                                                    	at io.invertase.firebase.common.ReactNativeFirebaseModule.invalidate(ReactNativeFirebaseModule.java:114)
                                                                                                    	at io.invertase.firebase.common.ReactNativeFirebaseModule.onCatalystInstanceDestroy(ReactNativeFirebaseModule.java:106)
                                                                                                    	at com.facebook.react.bridge.BaseJavaModule.invalidate(BaseJavaModule.java:71)
                                                                                                    	at io.invertase.firebase.common.ReactNativeFirebaseModule.invalidate(ReactNativeFirebaseModule.java:114)

Project Files

Javascript

Click To Expand

package.json:

{
  "name": "TestTest",
  "version": "1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@gorhom/bottom-sheet": "^4.6.4",
    "@react-native-async-storage/async-storage": "^1.23.1",
    "@react-native-firebase/app": "^21.6.0",
    "@react-native-firebase/messaging": "^21.6.0",
    "@react-navigation/bottom-tabs": "^6.6.0",
    "@react-navigation/native": "^6.1.17",
    "@react-navigation/native-stack": "^6.9.26",
    "@tanstack/query-async-storage-persister": "^5.53.1",
    "@tanstack/react-query": "^5.32.0",
    "@tanstack/react-query-persist-client": "^5.53.1",
    "axios": "^1.6.8",
    "axios-auth-refresh": "^3.3.6",
    "lodash.filter": "^4.6.0",
    "react": "18.2.0",
    "react-native": "0.73.7",
    "react-native-contacts": "^7.0.8",
    "react-native-device-info": "^13.0.0",
    "react-native-fast-image": "^8.6.3",
    "react-native-gesture-handler": "^2.20.0",
    "react-native-permissions": "^5.0.0",
    "react-native-reanimated": "^3.15.4",
    "react-native-safe-area-context": "^4.9.0",
    "react-native-screens": "^3.30.1",
    "react-native-svg": "^15.2.0",
    "zustand": "^4.5.2"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.73.21",
    "@react-native/eslint-config": "0.73.2",
    "@react-native/metro-config": "0.73.5",
    "@react-native/typescript-config": "0.73.1",
    "@tanstack/eslint-plugin-query": "^5.28.11",
    "@types/lodash.filter": "^4.6.9",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-native-svg-transformer": "^1.3.0",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }
}

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


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 15.0.1
  CPU: (8) arm64 Apple M1
  Memory: 114.50 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.6.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.17
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.2
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.08.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK:
    API Levels:
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-30 | Google Play ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10406996
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.7
    wanted: 0.73.7
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
  • 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:
    • ^21.6.0
  • Firebase module(s) you're using that has the issue:
    • Firebase Cloud Messaging
  • Are you using TypeScript?
    • Y & 5.0.4


@HyzamAli HyzamAli changed the title [🐛] Bug Report Title - CHANGE ME [🐛] Bug Report Title - App crashing on bundle reload [Android] Nov 24, 2024
@mikehardy
Copy link
Collaborator

Oh that's a shame - I must have made a mistake in this PR #8139
I'll have to repair that but in the meantime you can temporarily downgrade to v21.4.1 here (just before that PR released) or upgrade to react-native 0.74+
I'd recommend upgrading react-native to be honest, 0.73 is pretty old now and most modules only support current + 2 older versions meaning that you're out of support and 0.74 is just about to be clipped off support as well

But I'll fix this regardless, just might be a little bit - sorry for the crash

@mikehardy mikehardy changed the title [🐛] Bug Report Title - App crashing on bundle reload [Android] [🐛] App crashing on bundle reload [Android] on react-native 0.73 Nov 25, 2024
@mikehardy
Copy link
Collaborator

I've got a PR up that should fix it:

It's going to wait on approval before release but in the mean time you can use the patch-package set that's generated here from our CI system: https://github.com/invertase/react-native-firebase/actions/runs/12002173355?pr=8160

It's just a one-line diff though:

https://github.com/invertase/react-native-firebase/pull/8160/files

@HyzamAli
Copy link
Author

thanks @mikehardy for the quick response

@mikehardy
Copy link
Collaborator

released as 21.6.1 - thanks again for the report

@mikehardy mikehardy added resolution: fixed A fix has been merged into main. and removed Needs Attention labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed A fix has been merged into main. type: bug New bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants