反应本机崩溃:线程:SIGSEGV libjsc.so

时间:2020-12-23 04:21:29

标签: android react-native android-native-library

我们在 Android 设备的各个随机位置遇到以下崩溃。虽然我们把 ndk abifilters 改成了“armeabi-v7a”、“arm64-v8a”

  Crashed: Thread :  SIGSEGV  0x0000000000000010
  #00 pc 0x723d46f748 libjsc.so 
  #01 pc 0x723d4bbfe8 libjsc.so 
  #02 pc 0x7339d68b6c libc.so 

当前配置

RN 版本 0.63.4

 defaultConfig {
    ..
    ndk { abiFilters  "armeabi-v7a", "arm64-v8a" }
}
splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false  // If true, also generate a universal APK
        include "armeabi-v7a",
                "x86", "arm64-v8a", "x86_64"
    }
}

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

enter image description here

enter image description here

2 个答案:

答案 0 :(得分:1)

我只在 Android RN 0.59.5 上使用 JSC 遇到过这样的问题,唯一的方法是升级 JSC。

这个问题是由于在 JSC 深处发生的内存问题,我们几乎无能为力。

有关更多信息,请参阅这些主题:

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

https://github.com/facebook/react-native/pull/25426/files

但是由于您已经在使用 RN 0.63.4 版,唯一的方法是取消 JSC 并启用 Hermes。 Hermes 提供了许多性能优化,例如字节码、更快的冷启动等。阅读有关 here 的更多信息。

如果您愿意,可以在 react-native/package.json 中检查您的应用中使用的 JSC 版本,看看是否可以进一步升级。

答案 1 :(得分:0)

如果您正在使用 webview 并遇到问题,则在出现问题的屏幕中放置 animationEnabled: false

<Stack.Screen
        name="CampaygnsDetail"
        component={CampaygnsDetail}
        options={{
          animationEnabled: false,
        }}
        />