-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fixes SUPPRESS_ERROR_PAGE warning after webview_flutter_android upgrade #2182
Fixes SUPPRESS_ERROR_PAGE warning after webview_flutter_android upgrade #2182
Conversation
How override error pages if we no longer have disableDefaultErrorPage ? |
@EArminjon I can't say. This was a feature that was never launched in webkit:
This is a change performed in WebViewFeature.java almost a year ago. |
I need this fix ASAP, because I have this error. |
@pichillilorenzo I also need this fix, the webview just throw a SUPPRESS_ERROR_PAGE when opening. |
your code does the trick but the webkit update gets me another error if i open a webview in a new flutter page and i pop it, the app just crashes :
i guess it is because the webkit version in build.gradle is still in 1.8.0 (where the ScriptHandler is defined as an abstract class) and in the updated webkit (located in webview_flutter_android) the ScriptHandler is an interface, it creates a conflict between the two versions if i replace with a newer webkit version (in android/build.gradle line 52) it fixes my bug :
@Manuito83 can you tell me if you reproduce as well ? |
I was not getting this error with: implementation 'androidx.webkit:webkit:1.10.0' |
yes it also works with 1.10.0 but not with the actual one (1.8.0) defined in flutter_inappwebview_android/android/build.gradle |
LGTM |
it worked for me and i bumped pubspec.yaml
|
Personally i make the fix different to still support Old code if (!WebViewFeature.isFeatureSupported(WebViewFeature.SUPPRESS_ERROR_PAGE) &&
webView.customSettings.disableDefaultErrorPage) {} New code (as feature no longer supported and so should match 'false') if (webView.customSettings.disableDefaultErrorPage) { I also updated webkit inside android/build.gradle implementation 'androidx.webkit:webkit:1.11.0' I can create a new PR for that. |
@@ -299,12 +299,6 @@ public void onReceivedError(WebView view, @NonNull WebResourceRequest request, @ | |||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { | |||
final InAppWebView webView = (InAppWebView) view; | |||
|
|||
if (!WebViewFeature.isFeatureSupported(WebViewFeature.SUPPRESS_ERROR_PAGE) && | |||
webView.customSettings.disableDefaultErrorPage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just remove !WebViewFeature.isFeatureSupported(WebViewFeature.SUPPRESS_ERROR_PAGE) and keep the if
@@ -309,12 +309,6 @@ public void onReceivedError(@NonNull WebView view, | |||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { | |||
final InAppWebView webView = (InAppWebView) view; | |||
|
|||
if (!WebViewFeature.isFeatureSupported(WebViewFeature.SUPPRESS_ERROR_PAGE) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just remove !WebViewFeature.isFeatureSupported(WebViewFeature.SUPPRESS_ERROR_PAGE) and keep the if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep old code format. That make review very hard, didn't see what you have changed.
Please fix it, I need this update ASAP, thx. |
Can you test #2231 ? |
Yes, I have test #2231 , and
I have all the code checked, but I wonder how can I test your code on my own device. |
I implemented
in my projects build.gradle but am still getting the java.lang.IncompatibleClassChangeError
I've been stuck on this for most of the day so any direction would be appreciated |
You can try #2231 I use it inside a big app in production, it works well. |
Cannot thank you enough, this worked for me. Strangely i could not just clone and checkout the PR and build - have some weird problems in my flutter config still.... I was however able to patch .pub-cache with the changes and it fixes the problem perfectly. Again thanks! I hope the change is merged into the package Jim |
It's Works for me |
Released new version 6.1.0 with the fix, thanks! |
@pichillilorenzo is this update requires to have SDK version 3.5.0 or it might be used on a lower bound? because it's kinda high & not everyone has updated to latest version
|
@abdallah-odeh currently the |
Connection with issue(s)
Resolve issue #2150
Testing and Review Notes
The SUPPRESS_ERROR_PAGE feature was discontinued according to this change in Webkit's WebViewFeature.java.
The recent upgrade of webkit to 1.10.0 in webview_flutter_android causes the webview to be null.
This suppresses references to SUPPRESS_ERROR_PAGE.