react-native-rich-editor icon indicating copy to clipboard operation
react-native-rich-editor copied to clipboard

Crash on android

Open khanh21011999 opened this issue 3 years ago • 12 comments

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

khanh21011999 avatar Jan 28 '22 03:01 khanh21011999

I recently started experiencing the same issue as well

zchbndcc9 avatar Feb 04 '22 16:02 zchbndcc9

I am also facing same issue

anishmjn3 avatar Feb 10 '22 05:02 anishmjn3

Same issue - was working this morning now stopped

accompso-ltd avatar Feb 15 '22 14:02 accompso-ltd

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.

mlecoq avatar Feb 18 '22 21:02 mlecoq

  • 1, same here

gabrielbuzziv avatar Feb 18 '22 21:02 gabrielbuzziv

Add android:hardwareAccelerated="false" in AndroidManifest.xml

it worked for me!

bhunaapandian avatar Feb 21 '22 16:02 bhunaapandian

Instead of switching off the hardware acceleration globally, just passed 2 additional params to the component:

  • androidLayerType="software"
  • androidHardwareAccelerationDisabled

KazakovVS avatar Feb 24 '22 14:02 KazakovVS

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

davidwico avatar Feb 25 '22 14:02 davidwico

Thank You So Much @davidwico well worked On android 12

Vigneshwaran-crypto avatar Jun 13 '23 12:06 Vigneshwaran-crypto

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

tyawei avatar Feb 01 '24 12:02 tyawei

you can try add this to WebView as a prop: style={[otherStyleObj, {opacity: 0.99}]}

tyawei avatar Feb 01 '24 12:02 tyawei