-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Android 9: App crashes if hardware acceleration is enabled #575
Comments
Hello @Titozzz, |
Same issue here, works fine on older android versions but crashes on Android 9 and disabling hardware acceleration 'fixes' it. The content i have on my screen are 3 youtube iframes. Tried with 5.10.0. |
This is probably related to facebook/react-native#24261 |
No, I don't think so. I've used react-native-navigation [v1]. In my desperation I convert my app to the newer v2 version of rnn. Sadly the bug is still there, BUT if I disable the navigation animations, which is not really possible in rnn v1, the bug was worked around. So I think there must be an issue in the WebView, when it was animated and (un)mounted in the same time. @MaxMaes: Which navigation library did you use? |
@danielang I'm very sorry that your app is affected by this bug. If you find a solution, I'll be glad to review and merge it. 😍 |
react-native-navigation, latest release (but also happens with earlier minors of v2). |
Hey! Disabling hardware acceleration seems to fix it but embedded videos doesn't work anymore 😢 The app also uses RNN so, I'll try disabling animations and see if it work... |
So disabling the animations in I used this in order to fix the crash (and keep animations if supported):
I don't know if it works in Android Q (API 29) so maybe a |
I'm using react-navigation, but still facing this problem and #623 . With hardware acceleration disabled, embedded videos will not play anymore(only sound will play), so I don't think it's a valid workaround for me : (. @Embraser01 Do you have any clue how disabling the animations in react-native-navigation fixes this issue? |
|
Got the same issue here (Android 8, RN 0.59.10, RNN 2.22.3), one way to "fix" it without disabling animation on react-native-navigation or disabling it, application wide (via
|
@dimasdanz disabling hardwareAccelerated, some videos won't play anymore : ( |
@ouabing yeah, seems video tag videos only plays the audio while displaying a constant gray screen. |
wow. i just wasted 3 hours of my life on this. Can we get something in the readme until this is fixed? It is a common enough pattern to use react-native-navigation that I'm sure this is a widespread issue. |
Disabling hardware acceleration isn't always a good solution. If you can't predict the weight of your webview content (especially embeds), you can then have software layer issues. And I'm not sure there is a workaround for that nor it can be increased (something like largeHeap). |
Hey @dimasdanz, can you help verify the PR to see if this resolves the issue. |
🎉 This issue has been resolved in version 7.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Read that this issue might be fixed in newer versions by react-native-webview/react-native-webview#575 (comment)
I am still running into this using the latest version of webview :/ |
Will do. cc @daniocean |
facing the same prob,disabling hardware acceleration makes the webview responsiveness laggy which is undesirable but is solving the crash issue. |
Same situation with a WebView opening in a React Navigation stack. Running in Expo SDK 37 so it's Also I only get this crash on a Samsung S10+ (Android 10). My Moto e5 cruise (Android 8) does not get it. |
Hi @Rohansi, can you try disabling the animation of react-navigation? |
Yes, that fixes the crash. |
Still having this issue in If you are using Sample code: constructor(props: Props) {
this.state = {
showWebView: Platform.OS !== 'android'
};
if (Platform.OS === 'android') {
this.willBlurListener = this.props.navigation.addListener('willBlur', () => {
this.setState({ showWebView: false });
});
this.didFocusListener = this.props.navigation.addListener('didFocus', () => {
this.setState({ showWebView: true });
});
}
}
componentWillUnmount() {
if (Platform.OS === 'android') {
if (this.willBlurListener) this.willBlurListener.remove();
if (this.didFocusListener) this.didFocusListener.remove();
}
}
render() {
return (
...
{this.state.showWebView ? // render web view
: undefined }
)
} |
* Fix react-native-webview#575 * Check if hardware acceleration is available also * Alternative way to check isHarewareAccelerated
Glad to have found this thread, this gave us a clue that disabling animations could give us a fix. Our case was slightly different as we were using react-native-screens for perf reasons and unfortunately for us, they had moved the documentation from RNN docs, which is now available here We got it working after adding
|
Also if you add |
If you are using react-navigation, try this: // enableScreens(); which saved us from crash |
can we reopen this? |
rn 0.62.2 still have this problem. please reopen this issue |
I was having this problem using React-Navigation 4x and 5x. You can try disabling React-Native: 062.2 |
Check my answer in #1069. It could help. |
Had similar problem with react-navigation and react-native-webview.
|
Same with me. |
Just here to say boy did this bug ever ruin my life for about 2 weeks and cause us to have to move back a launch. |
I'm having this crash using |
https://sentry.io/share/issue/24df2e5df0df47e299e93a2ada69c94c/ Architectures | [arm64-v8a, armeabi-v7a, armeabi] Kernel Version | 4.4.23+ I am thinking this is the same issue considering I'm also using Webview with hardware acceleration for a tonne of animations. |
This is still an issue on as of March 2021. React Navigation stack screen crashing on android but not on iOS unless the |
Below is the options you can try: (1)
(2) Disable react-native-screens for (3) Try to prevent the crash
(4) Explore some alternatives, like react-native-render-html. |
The |
* Fix react-native-webview/react-native-webview#575 * Check if hardware acceleration is available also * Alternative way to check isHarewareAccelerated
Settings |
Bug description:
Our app crashes on Android 9 if the hardware acceleration was used in the webview.
If I disable the hardware acceleration on the embedded webviews the app works fine.
If I disable the acceleration in the AndroidManifest the app also works without crashes.
So I think it has something to do with the webview implementation and their usage of the hardware acceleration on Android 9.
To Reproduce:
The bug occurse in our currently productive app. The repository could be found here: postillonmedia/app
Expected behavior:
The app should not crash when the acceleration is enabled 😄
Screenshots/Videos/Traces:
Current reports of the Google-Play console
One of the traces:
Environment:
Known devices
Galaxy Note9 (crownlte)
Galaxy Note8 (greatlte)
Galaxy S9 (starlte)
Galaxy S9+ (star2lte)
Galaxy S8 (dreamlte)
Galaxy S8+ (dream2lte)
P20 Pro (HWCLT)
Mate 10 Pro (HWBLA)
Mate 20 Pro (HWLYA)
P20 (HWEML)
Mate 20 (HWHMA)
Honor 10 (HWCOL)
Honor Play (HWCOR)
Mate 10 (HWALP)
Honor V10 (HWBKL)
P10 (HWVTR)
Honor 9 (HWSTF)
Honor 8X (HWJSN-H)
HONOR V20 (HWPCT)
HUAWEI P smart 2019 (HWPOT-H)
Mate 9 (HWMHA)
HUAWEI P30 lite (HWMAR)
Honor 10 Lite (HWHRY-H)
P10 Plus (HWVKY)
Mate 20 lite (HWSNE)
Xperia XZ1 Compact (G8441)
Xperia XZ1 (G8341)
Xperia XA2 (H3113)
Xperia XZ Premium (G8141)
Xperia XA2 Ultra (H4213)
Xperia 10 (I4113)
Pixel (sailfish)
Pixel 2 (walleye)
Pixel 2 XL (taimen)
Pixel 3 (blueline)
Pixel 3 XL (crosshatch)
moto g(6) (ali_n)
moto g(6) plus (evert_n)
moto g(6) play (aljeter)
All devices runs Android 9
The text was updated successfully, but these errors were encountered: