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

WebView crashes when it gets loaded on emulator for the second time #14

Open
Invertisment opened this issue Mar 14, 2021 · 5 comments
Open

Comments

@Invertisment
Copy link

Invertisment commented Mar 14, 2021

When I test my app on emulator (API 30 with Android 10.0+) I can't load the component for the second time. It crashes the app and I can't catch the error using ErrorBoundary component.

It doesn't crash on a real Android device (Android 7.0 which would be API 21 and no updated Chromium WebView) no matter how many times I reload the captcha component. So it's related to the emulator or versions of Android libraries in it.

I found these issues which say that that there is an issue with current Chrome:
rishichawda/react-native-qrcode-generator#23
react-native-webview/react-native-webview#429 (comment)

Is it fine to have a small PR that applies their fixes?

@Invertisment Invertisment changed the title WebView crashes second time when loaded on emulator WebView crashes when loaded on emulator second time Mar 14, 2021
Invertisment added a commit to Invertisment/react-native-recaptchav3 that referenced this issue Mar 14, 2021
@Invertisment Invertisment changed the title WebView crashes when loaded on emulator second time WebView crashes when it gets loaded on emulator for the second time Mar 14, 2021
@Invertisment
Copy link
Author

It doesn't crash if emulator has API 27

@catalinberta
Copy link

I confirm the same scenario. If the component is reloaded (upon navigation) to regenerate the token, it crashes on Android, but not on iOS.

@Invertisment
Copy link
Author

Also opacity and hardware acceleration fixes don't work to fix this one.

@catalinberta
Copy link

catalinberta commented Mar 23, 2021

Adding androidHardwareAccelerationDisabled to the WebView component fixed it for me. Though I reckon this is just a temporary solution until react-native-webview fixes this.
Problem is that react-native-recaptchav3 does not expose props for the webview or its container. This would be a good occasion to add them

@amitkumar144
Copy link

Use this

https://www.npmjs.com/package/react-native-secure-captcha-v3

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

No branches or pull requests

3 participants