Skip to content

Android: onError() implementation is deficientΒ #3289

@birdofpreyru

Description

@birdofpreyru

Bug description:

The onError() implementation for Android (see below), in its native layer, overrides the version of onReceivedError() method deprecated in Android API 23 (thus, since 2015 β€” this library is really well-maintained 🀣 )

@Override
public void onReceivedError(
WebView webView,
int errorCode,
String description,
String failingUrl) {

and unlike the new version of the method the old one is fired for the main resource errors only β€” you get the error only if it failed to load the URI passed into the source itself, if it failed to load assets it depends upon (like JS scripts, CSS sheets, and other stuff required by the main resource) you won't get any error, even if it breaks the page and deserves an attempt to reload the page, or some other error-handling in your host app.

P.S.: As this is one is a sensitive problem for myself, I'll fix it and create PR shortly. If anybody is willing to say thanks for that, I am accepting donations via GitHub.Sponsors πŸ˜‰

To Reproduce:

Expected behavior:

Screenshots/Videos:

Environment:

  • OS:
  • OS version:
  • react-native version:
  • react-native-webview version:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions