react-native-webview / react-native-webview

React Native Cross-Platform WebView
https://github.com/react-native-community/discussions-and-proposals/pull/3
MIT License
6.31k stars 2.96k forks source link

iOS New Architecture Crashing #3361

Closed connorpmullins closed 4 weeks ago

connorpmullins commented 3 months ago

Bug description: Our react native project is on version 0.72.6 and uses the new architecture. We're rendering a webview that returns a mapbox map with injectable HTML and javascript. It's a fairly complex and likely atypical use of webview.

I'm attempting to upgrade from react-native-webview version 13.6.3 to 13.8.1.

The reason for this is that in 13.6.3 in iOS there is a bug that occasionally occurs when we dismiss the webview that causes all screen elements rendered prior to the webview to become un-touchable. The app appears frozen except for elements rendered after the webview, which work as expected.

This bug is hard to reproduce and not the subject of this bug report, it's just the reason for the upgrade.

The real issue is that when I upgrade the webview, it crashes immediately with the following code:

W0315 10:45:06.626423 1869197312 UIManagerBinding.cpp:124] instanceHandle is null, event will be dropped
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RNCWebViewImpl destroyWebView]: unrecognized selector sent to instance 0x1289fea00'
*** First throw call stack:
(0x18d336678 0x1855c7c80 0x18d3c6fdc 0x1902a9828 0x1031f5980 0x18d27bb34 0x18d3bc950 0x1031ec5b8 0x102afa300 0x102afa114 0x102b0c7b8 0x102d8cb70 0x102b0ba10 0x102b0b964 0x1952486a8 0x19524a300 0x195258998 0x1952585b0 0x18d280f9c 0x18d27dca8 0x18d27d3f8 0x1d08334f8 0x18f6a38a0 0x18f6a2edc 0x102835380 0x1affe6dcc)
libc++abi: terminating due to uncaught exception of type NSException

To Reproduce: I'm pretty confident it's this exact same bug: https://github.com/react-native-webview/react-native-webview/issues/3043

Expected behavior: The app probably shouldn't crash.

Screenshots/Videos: N/A

Environment:

Francesco-Voto commented 3 months ago

Hi @connorpmullins, this problem is related to React Native, a fix was release with RN 0.73.5 but it has not yet backported in RN 0.72.

Check here if you can

github-actions[bot] commented 1 month ago

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