react-native-rich-editor
react-native-rich-editor copied to clipboard
Crash on android
App crash when i navigate to android from flatlist, i tried androidHardwareAccelerationDisabled
but not work, please help
Version detail
"react-native-webview": "^11.17.1",
"react-native-pell-rich-editor": "^1.8.8",
"react-native": "^0.67.1",
The code
<RichEditor
androidHardwareAccelerationDisabled
editorInitializedCallback={() => {
richText?.current?.setFontName("Montserrat");
}}
ref={richText}
editorStyle={{
cssText: fontEditor,
contentCSSText: editorCss,
// backgroundColor: color.backgroundGrey,
}}
onChange={(descriptionText) => {
console.log("descriptionText:", descriptionText);
}}
/>
Behavior
https://user-images.githubusercontent.com/37074707/151480856-bae059ae-c50f-432d-843f-2ae2c882d8dc.mov
I recently started experiencing the same issue as well
I am also facing same issue
Same issue - was working this morning now stopped
I had the same issue, looking into sentry I have the following stack trace
Application Specific Information:
Segfault
Thread 0 Crashed:
0 libhwui.so 0x732f63aadc SkSurface::getCanvas
1 libhwui.so 0x732f72a6bc android::MinikinFontSkia::GetSkTypeface
2 libhwui.so 0x732f60bd10 SkCanvas::onDrawDrawable
3 libhwui.so 0x732f5f964c SkPath::addRect
4 libhwui.so 0x732f60bcac SkCanvas::onDrawDrawable
5 libhwui.so 0x732f5f964c SkPath::addRect
6 libhwui.so 0x732f60bcac SkCanvas::onDrawDrawable
7 libhwui.so 0x732f5f964c SkPath::addRect
8 libhwui.so 0x732f60bcac SkCanvas::onDrawDrawable
9 libhwui.so 0x732f5f964c SkPath::addRect
10 libhwui.so 0x732f60bcac SkCanvas::onDrawDrawable
11 libhwui.so 0x732f5f964c SkPath::addRect
12 libhwui.so 0x732f62cf90 SkCanvas::concat
13 libhwui.so 0x732f63d1e8 GrRenderTargetContext::internalClear
14 libhwui.so 0x732f63a5cc GrBackendRenderTarget::~GrBackendRenderTarget
15 libhwui.so 0x732f63a238 SkCanvas::drawPaint
16 libhwui.so 0x732f68d0d0 SkString::appendf
17 libhwui.so 0x732f68c28c SkString::appendf
There is a known hack adding opacity: 0.99
to the style of the WebView. I have tried it and it works.
- 1, same here
Add android:hardwareAccelerated="false" in AndroidManifest.xml
it worked for me!
Instead of switching off the hardware acceleration globally, just passed 2 additional params to the component:
- androidLayerType="software"
- androidHardwareAccelerationDisabled
Like @KazakovVS suggests, you can pass androidLayerType
prop with software
value to underlying web view:
<RichEditor
androidLayerType="software"
...
/>
androidHardwareAccelerationDisabled
is deprecated according to react-native-webview documentation,
so there is no need to use it
Thank You So Much @davidwico well worked On android 12
Instead of switching off the hardware acceleration globally, just passed 2 additional params to the component:
- androidLayerType="software"
- androidHardwareAccelerationDisabled
this way may cause the rich text abnormally displays...especially you have a large amount of rich texts. for example, rich text may lose some or disappears
you can try add this to WebView as a prop: style={[otherStyleObj, {opacity: 0.99}]}
Related on Stack Overflow: React native react-native-pell-rich-editor crash on Android navigation to screen