facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.51k stars 24.37k forks source link

Android App Crash When Update 0.71.7, FATAL EXCEPTION: mqt_native_modules #37330

Closed breewf closed 1 year ago

breewf commented 1 year ago

Description

Update RN version 0.68.5 to 0.71.7

https://react-native-community.github.io/upgrade-helper/?from=0.68.5&to=0.71.7

Carsh when i close RN page, error:

FATAL EXCEPTION: mqt_native_modules com.facebook.react.common.JavascriptException: TypeError: undefined is not a function

This error is located at: in App in Router in RCTView in Unknown in App in Provider in RootComponent in CodePushComponent in RCTView in Unknown in RCTView in Unknown in AppContainer, js engine: hermes, stack: componentWillUnmount@1:914395 commitDeletionEffectsOnFiber@1:328390 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328560 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328711 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328952 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328560 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328421 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328952 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328560 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328421 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328421 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328711 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328952 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328560 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328711 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328952 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328560 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328952 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328421 recursivelyTraverseDeletionEffects@1:328154 commitDeletionEffectsOnFiber@1:328952 recursivelyTraverseMutationEffects@1:329370 commitMutationEffectsOnFiber@1:330530 commitRootImpl@1:339106 commitRoot@1:338701 performSyncWorkOnRoot@1:335671 flushSyncCallbacks@1:300023 scheduleUpdateOnFiber@1:332702 updateContainer@1:343664 unmountComponentAtNode@1:343920 anonymous@1:353158 unmountComponentAtNodeAndRemoveContainer@1:91868 unmountApplicationComponentAtRootTag@1:238889 callFunction@1:83323 anonymous@1:81693 guard@1:82643 callFunctionReturnFlushedQueue@1:81651

at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.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.jni.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) at android.os.Looper.loopOnce(Looper.java:240) at android.os.Looper.loop(Looper.java:351) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228) at java.lang.Thread.run(Thread.java:1012)

=============================================================

This only happened Android, ios is OK. And only occurs on pages that use router(Navigation), I'm not sure if it's a router issue.

Also got the same error using jsc engine. error:TypeError: _reactNative.Linking.removeEventListener is not a function

similar Issue: https://github.com/react-navigation/react-navigation/issues/9183

=============================================================

"dependencies": { "@ant-design/icons-react-native": "^2.3.2", "@ant-design/react-native": "^5.0.4", "@babel/preset-env": "^7.1.6", "@react-native-async-storage/async-storage": "^1.18.1", "@react-native-camera-roll/camera-roll": "^5.2.3", "@react-native-community/art": "1.2.0", "@react-native-community/masked-view": "^0.1.11", "@react-native-community/segmented-control": "^2.2.2", "@react-native-community/slider": "^4.4.2", "@react-native-picker/picker": "^2.4.10", "@react-navigation/native": "^6.1.6", "@react-navigation/native-stack": "^6.9.12", "@types/react-native": "^0.71.6", "add": "^2.0.6", "ahooks": "^3.7.6", "axios": "^1.3.2", "buffer": "^6.0.3", "crypto-js": "^4.1.1", "deprecated-react-native-listview": "^0.0.8", "http-proxy-middleware": "^2.0.6", "lottie-ios": "^3.4.0", "lottie-react-native": "^5.1.5", "prop-type": "^0.0.1", "prop-types": "^15.8.1", "react": "18.2.0", "react-native": "0.71.7", "react-native-cli": "^2.0.1", "react-native-code-push": "^8.0.1", "react-native-gesture-handler": "^2.9.0", "react-native-reanimated": "^3.1.0", "react-native-router-flux": "^4.3.1", "react-native-safe-area": "^0.5.1", "react-native-safe-area-context": "^4.5.2", "react-native-screens": "^3.20.0", "react-native-simple-store": "^2.0.2", "react-native-storage": "^1.0.1", "react-native-swRefresh": "^1.2.3", "react-native-swipe-list-view": "^3.2.9", "react-native-webview": "^11.26.1", "react-redux": "^8.0.5", "recyclerlistview": "^4.2.0", "redux": "^4.2.1", "redux-logger": "^3.0.6", "redux-promise-middleware": "^6.1.3", "redux-thunk": "^2.4.2", "rn-vconsole-panel": "^1.0.3", "use-subscription": "^1.8.0", "yarn": "^1.22.19" },

React Native Version

0.71.7

Output of npx react-native info

System: OS: macOS 12.6.5 Shell: 3.2.57 - /bin/bash Binaries: Node: 14.17.4 Yarn: 1.22.19 npm: 9.2.0 Watchman: Not Found Managers: CocoaPods: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9862592 Xcode: /undefined - /usr/bin/xcodebuild Languages: Java: 11.0.18 - /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.7 => 0.71.7 react-native-macos: Not Found

Steps to reproduce

Go to the RN page, back, and the crash happen.

Snack, code example, screenshot, or link to a repository

similar Issue:

https://github.com/facebook/react-native/issues/33916

https://github.com/facebook/react-native/issues/29165

github-actions[bot] commented 1 year ago
:warning: Missing Reproducible Example
:information_source: It looks like your issue is missing a reproducible example. Please provide either:
breewf commented 1 year ago

Found the cause of the problem, it is a router problem, solutions can be found here: https://github.com/aksonov/react-native-router-flux/issues/3844

Modify the Router.js file source code, Location: xxx/xxx/node_modules/react-native-router-flux/src/Router.js

In addition, we intend to deprecate this library, which has not been updated for two years, and use the official Navigation.