Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set androidLayerType on WebView to prevent crash on Android 12 #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

endronk
Copy link

@endronk endronk commented Feb 28, 2022

Issue

On Android 12 (I didn't test on Android 9), React Native Plotly always crashes with null pointer dereference issue (see crash log).

The same issue also occurred here (on Android 9): react-native-webview/react-native-webview#1069

Solution

The issue can be solved by setting androidHardwareAccelerationDisabled to true. However, that prop has been deprecated (see this) and we should use androidLayerType instead.

The above solution has been tested on Android phone as well as emulator.

@rynobax
Copy link
Owner

rynobax commented Mar 1, 2022

I don't have any issues using this library on Android 12. If you need to set the androidLayerType for you use case, I would be ok if you made a prop for the Plotly component that is then passed into the webview, but I don't want to change the default.

@endronk
Copy link
Author

endronk commented Mar 10, 2022

Sorry for the slow response. Yeah, I think it's a good idea. I will modify it on the weekend.
It has something to do with the data that we pass to the WebView. So, for certain data, it causes crash.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants