fluttercommunity / fluttercommunity/flutter_webview_plugin

warning: [deprecation] (shouldOverrideUrlLoading,onReceivedError,removeAllCookie) in WebViewClient has been deprecated

Open
#734 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.5k
Forks
936
PR merge metrics
No merged PRs in 30d

Description

System info

Issue occurs on: Android
Plugin version: ^0.3.11
Flutter doctor output:

[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18362.476], locale en-US)
    • Flutter version 1.12.13+hotfix.9 at C:\Android\flutter
    • Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Android\sdk\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = C:\Android\sdk\sdk\platform-tools
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[!] IntelliJ IDEA Community Edition (version 2019.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.1
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[√] VS Code (version 1.37.1)
    • VS Code at C:\Users\Amr Abd Alkrim\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 2.25.1

[√] Connected device (1 available)
    • G8 • 1090308019017967 • android-arm64 • Android 9 (API 28)

! Doctor found issues in 2 categories.

Logs

C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.3.11\android\src\main\java\com\flutter_webview_plugin\BrowserClient.java:80: warning: [deprecation] shouldOverrideUrlLoading(WebView,String) in WebViewClient has been deprecated
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
                   ^
C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.3.11\android\src\main\java\com\flutter_webview_plugin\BrowserClient.java:103: warning: [deprecation] onReceivedError(WebView,int,String,String) in WebViewClient has been deprecated
    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
                ^
C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.3.11\android\src\main\java\com\flutter_webview_plugin\BrowserClient.java:104: warning: [deprecation] onReceivedError(WebView,int,String,String) in WebViewClient has been deprecated
        super.onReceivedError(view, errorCode, description, failingUrl);
             ^
C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.3.11\android\src\main\java\com\flutter_webview_plugin\FlutterWebviewPlugin.java:310: warning: [deprecation] removeAllCookie() in CookieManager has been deprecated
            CookieManager.getInstance().removeAllCookie();
                                       ^
C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.3.11\android\src\main\java\com\flutter_webview_plugin\WebviewManager.java:346: warning: [deprecation] removeAllCookie() in CookieManager has been deprecated
            CookieManager.getInstance().removeAllCookie();
                                       ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 warnings

[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18362.476], locale en-US)
    • Flutter version 1.12.13+hotfix.9 at C:\Android\flutter
    • Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Android\sdk\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = C:\Android\sdk\sdk\platform-tools
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[!] IntelliJ IDEA Community Edition (version 2019.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2.1
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[√] VS Code (version 1.37.1)
    • VS Code at C:\Users\Amr Abd Alkrim\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 2.25.1

[√] Connected device (1 available)
    • G8 • 1090308019017967 • android-arm64 • Android 9 (API 28)

! Doctor found issues in 2 categories.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with BrowserClient.java, FlutterWebviewPlugin.java, and WebviewManager.java, locating the methods named in the compiler warnings: shouldOverrideUrlLoading, onReceivedError, and removeAllCookie. Rebuild the Android plugin and verify that these deprecation warnings are gone without changing the WebView behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.