Dee*_*rai 5 react-native react-native-render-html
当在 中启用屏幕react-native-screens,并且有一个屏幕呈现一个<HTML />通过iframeHTML 元素传递的组件时,应用程序会在按下后退按钮返回主屏幕时崩溃。完整再现这里。
07-29 17:41:49.173 6901 6901 F crashpad: dlopen: dlopen failed: library "libandroidicu.so" not found: needed by /system/lib/libharfbuzz_ng.so in namespace (default)
--------- beginning of crash
07-29 17:41:49.176 6410 6441 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c in tid 6441 (RenderThread), pid 6410 (com.newmednav)
07-29 17:41:49.340 6904 6904 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-29 17:41:49.340 6904 6904 F DEBUG : Build fingerprint: 'google/sdk_gphone_x86_arm/generic_x86_arm:11/RPB2.200611.009/6625208:userdebug/dev-keys'
07-29 17:41:49.340 6904 6904 F DEBUG : Revision: '0'
07-29 17:41:49.340 6904 6904 F DEBUG : ABI: 'x86'
07-29 17:41:49.340 6904 6904 F DEBUG : Timestamp: 2020-07-29 17:41:49+0545
07-29 17:41:49.340 6904 6904 F DEBUG : pid: 6410, tid: 6441, name: RenderThread >>> com.newmednav <<<
07-29 17:41:49.340 6904 6904 F DEBUG : uid: 10152
07-29 17:41:49.340 6904 6904 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c
07-29 17:41:49.340 6904 6904 F DEBUG : Cause: null pointer dereference
07-29 17:41:49.340 6904 6904 F DEBUG : eax efbc2cb0 ebx eed5c69c ecx eed52a80 edx 00000000
07-29 17:41:49.341 6904 6904 F DEBUG : edi d139ae90 esi 00000000
07-29 17:41:49.341 6904 6904 F DEBUG : ebp c086ed48 esp c086eb50 eip ee698c1c
07-29 17:41:49.425 6904 6904 F DEBUG : backtrace:
07-29 17:41:49.425 6904 6904 F DEBUG : #00 pc 00247c1c /system/lib/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+1548) (BuildId: 434a9b68672e1dd2b15599730362463d)
07-29 17:41:49.425 6904 6904 F DEBUG : #01 pc 00303a57 /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+87) (BuildId: 434a9b68672e1dd2b15599730362463d)
07-29 17:41:49.425 6904 6904 F DEBUG : #02 pc 002f4606 /system/lib/libhwui.so (SkBaseDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+38) (BuildId: 434a9b68672e1dd2b15599730362463d)
07-29 17:41:49.425 6904 6904 F DEBUG : #03 pc 00659291 /system/lib/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+353) (BuildId: 434a9b68672e1dd2b15599730362463d)
07-29 17:41:49.425 6904 6904 F DEBUG : #04 pc 002d9dc0 /system/lib/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+48) (BuildId: 434a9b68672e1dd2b15599730362463d)
Run Code Online (Sandbox Code Playgroud)
这是由react-native-webview和之间的不兼容引起的react-native-screens,如果您使用的是@react-navigation/*包,则必须依赖于它。
编辑:从那以后似乎出现了回归。它正在这里被跟踪。
react-native-screens@2.12.0请参阅https://github.com/software-mansion/react-native-screens/releases/tag/2.12.0 中的更改日志
有3种解决方法:
const tagsStyles = {
iframe: {
opacity: 0.99
},
// If you are using @native-html/table-plugin
table: {
opacity: 0.99
}
}
Run Code Online (Sandbox Code Playgroud)
并在渲染时使用此道具:
return <HTML tagsStyles={tagsStyles} ... />
Run Code Online (Sandbox Code Playgroud)
在android/app/src/main/AndroidManifest.xml:
<activity
android:hardwareAccelerated="false"
/>
Run Code Online (Sandbox Code Playgroud)
从您的App.js文件:
// import {enableScreens} from 'react-native-screens';
// enableScreens();
Run Code Online (Sandbox Code Playgroud)
小智 6
另一项修复是在 navigationOptions 中禁用反应导航动画。
static navigationOptions = () => ({
animationEnabled: false,
});
Run Code Online (Sandbox Code Playgroud)
小智 0
更新的解决方案是androidLayerType="software",因为androidHardwareAccelerationDisabled现已弃用。
前任:-
<AutoHeightWebView
androidHardwareAccelerationDisabled // update here androidLayerType="software"
...
/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2016 次 |
| 最近记录: |