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
react navigation stack + react native screens + react native webview will crash (null pointer dereference) when the pop stack #6960
Comments
Same here. Both, Android emulator and real device. I use ...
<WebView
androidHardwareAccelerationDisabled={true}
... Credits to @emeraldsanto on stackoverflow. |
This seems like something which needs to be fixed in react-native-webview. Closing since it's not actionable for us and workaround is mentioned. |
The updated solution for this is |
Leaving this here for future readers:
Some HTML would render properly, but other wouldn't. Be careful with |
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
I can confirm by adding |
With me the androidHardwareAccelerationDisabled property didn't solve it , I even tried disabling hardware acceleration directly in AndroidManifest with The androidLayerType="software" property avoided the crash of react native render html/react native webview with videos, but when using it, it made the videos not work anymore(the video no longer showed image, only sound) and as mentioned above, sometimes it visually affected some HTML. So, taking a look at the possible values it could receive, I used it as: androidLayerType="hardware" and it worked perfectly, whether on the emulator or physical Android device. Any problems using with the value as hardware? import RenderHtml from 'react-native-render-html';
...
<RenderHtml
renderers={{ iframe: IframeRenderer }}
WebView={WebView}
defaultWebViewProps={{
androidLayerType: 'hardware',
}}
contentWidth={width * 0.9}
source={{ html: html.replace(/src="\/\//g, 'src="https://') }}
customHTMLElementModels={{ iframe: iframeModel }}
renderersProps={{ iframe: { scalesPageToFit: true } }}
/> |
react-native-webview/react-native-webview#811 (comment) <WebView
style={{ opacity: 0.99 }}
/> |
Current Behavior
react navigation stack + react native screens + react native webview will crash (null pointer dereference) when the pop stack
Expected Behavior
working fine
How to reproduce
react navigation stack + react native screens + react native webview will crash (null pointer dereference) after the pop webview's stack screen
Your Environment
latest
The text was updated successfully, but these errors were encountered: