I have a screen A and after performing some POST API task, I enable a button to be clicked to be navigated to screen B. That's when the React Native app freezes and crashes, the crash happens randomly. And navigating from other screens to screen B is not a problem, its only screen A from where I am not able to navigate away.
我有一个屏幕A,在执行了一些POST API任务后,我启用了一个按钮,然后单击按钮导航到屏幕B。当Reaction Native应用程序冻结并崩溃时,崩溃会随机发生。从其他屏幕导航到屏幕B也不是问题,它是唯一一个我无法离开的屏幕A。
Crash Error - Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20 in tid 1506 (RenderThread), pid 717 (com.wmecm2)
崩溃错误-致命信号11(SIGSEGV),代码1(SEGV_MAPERR),TID 1506(RenderThread)中的故障地址0x20,PID 717(com.wmecm2)
"dependencies": {
"@react-navigation/native": "^6.0.13",
"@react-navigation/stack": "^6.3.1",
"react-native-webview": "^12.1.0",
...
}
I tried to find the logs using debug apk on Android studio. Below is the screenshot of the logs
我试着在Android Studio上使用调试APK来查找日志。以下是日志的屏幕截图
更多回答
优秀答案推荐
This fixed the same issue for me:
这为我解决了同样的问题:
const androidLayerType = Platform.OS === 'android' ? (+sdkLevel >= 31 ? 'hardware' : 'software') : undefined;
...
<WebView ... androidLayerType={androidLayerType}
更多回答
我是一名优秀的程序员,十分优秀!