-
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
Android9 Crash Due To androidHardwareAccelerationDisabled #1069
Comments
I am facing the same crash in Android 9 and also 10. This is happening when hardware acceleration is enabled by default. It gets fixed by using Disabling hardware acceleration doesn't help me as I am using WebGL APIs in my webpage which requires hardware acceleration to render. Can someone help resolve this NDK crash?
|
Facing the same crash on Android 10. Will try disabling hardware acceleration now. Edit: Can confirm disabling hardware acceleration fixes this! OS: Android |
I am also facing the same issue in production build. This only happens for me the first time app starts. After the crash when I open the app again it works fine. |
@Titozzz This issue seems to have passed unnoticed and is causing a lot of headache since turning hardware acceleration off just isn't a feasible solution. |
Guys, make sure your Webview always has a height of 1 or bigger. In my case my webview had 0 height until we send back the html content's height back. |
@ItsNoHax this is how I am using it.
|
Yeah flex: 1 in a scrollview doesn’t work and I tried using minHeight but
it didn't work for me. Try using height: 1 just to see if it stops crashing
…On Thu, 16 Jan 2020 at 18:28, UmaR Aamer ***@***.***> wrote:
@ItsNoHax <https://github.com/ItsNoHax> this is how I am using it.
<WebView
style={{
flex: 1,
minHeight: 200 }}
/>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1069>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAHDSWGR6SM2HNPLURRGN3Q6CKKPANCNFSM4JYD5Y3A>
.
|
@Titozzz Hardware Acceleration on Android is causing a lot of crashes! In our case disabling hardware acceleration is not a possible solution since we need to render bigger pieces of HTML. |
Worked for me
|
Experiencing the same issue. cc @kokuls can you drop some of your investigation in this thread |
目前我的方案是重写RNCWebViewManager
并且在应用这个库的地方把androidHardwareAccelerationDisabled设置为true
强制把硬件加速给关了,切记开软件加速View.LAYER_TYPE_SOFTWARE也不行,会导致另外一个问题
导致这个问题的原因是ScollView嵌套了WebView,导致Webview不确定大小,而且Webview启动了硬件加速或者软件加速,由于硬件加速或者软件加速是有个最大的缓存区域的,最终导致超过了缓存范围。这个估计也不是官方库的Bug,是Android的Bug,他们也没有办法处理! |
same issue |
updating the webview component from playstore fixed the issue for us |
playstore? |
Yes, I mean updating chrome and It's webview component on the actual phone trough Google's playstore |
react-native-render-html can help... |
Yes! I'm already Instead! |
Are you using react-native-navigation by any chance? I had a very similar stacktrace to you and managed to “fix” the bug by disabling screen transition animations. |
Also using react-navigation. Fixed in my case by setting the https://reactnavigation.org/docs/stack-navigator#transparent-modals
|
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
This is still happening in the latest version. Please reopen. |
I had the same issue.
|
tkank you, it work for me <3 |
Is this still an issue? |
yes :( |
@SS-In thanks , this works for me |
setting opacity to 0.99 solves it |
This works, But how you understood this issue? |
I had the exact same issue using a youtube wrapper around a WebView. It would occasionally crash the android app when navigating from/to (react-navigation) the view using WebView. It seemed non-deterministic and happen on some devices more often than others. By setting |
If you dont want to fix a height, just use minHeight prop + opacity, works as expected. I believe that there is some incompatibility with react navigation, only when using the webview together with this lib that this problem occurs, a deeper study is needed to find out what happens. There are some clues in the logcat but I'm not so good with native code lol. |
Add "androidLayerType={'hardware'}" it work for me.
|
From version 10.8.0 the prop
Make sure to not set both props at the same time, for me doing this would cause the app to fail without any logs. Just set: <Webview androidLayerType="hardware" .... /> |
We've had success by:
Views must have a minimum height of 1 if they are to be set to a hardware layer type! Why does this work?
TL;DR: For anyone else setting the opacity to anything other than 1, Android is automatically setting the layer type of the webview to Under the hood, setting the When a view has a layer type that is of |
Just add
|
Bug description:
Android9使用你们的库,由于硬件加速原因会报如下错误,试过用原生WebView没有这个问题!
Environment:
The text was updated successfully, but these errors were encountered: