Skip to content

deprecated warnings using java 17 #2685

@erfanegtfi

Description

@erfanegtfi

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

after I upgraded my java version in gradle

 compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
        //  Dependency ':flutter_local_notifications' requires core library desugaring to be enabled for :app.
        coreLibraryDesugaringEnabled true 
    }

    kotlinOptions {
        jvmTarget = '17'
    }

I got bunch of deprecated warnings

flutter_inappwebview_android-1.2.0-beta.2\android\src\main\java\com\pichillilorenzo\flutter_inappwebview_android\MyCookieManager.java:6: warning: [deprecation] CookieSyncManager in android.webkit has been deprecated
import android.webkit.CookieSyncManager;
                     ^
flutter_inappwebview_android-1.2.0-beta.2\android\src\main\java\com\pichillilorenzo\flutter_inappwebview_android\webview\in_app_webview\InAppWebViewClient.java:14: warning: [deprecation] CookieSyncManager in android.webkit has been deprecated
import android.webkit.CookieSyncManager;
                     ^
flutter_inappwebview_android-1.2.0-beta.2\android\src\main\java\com\pichillilorenzo\flutter_inappwebview_android\webview\in_app_webview\InAppWebViewClientCompat.java:14: warning: [deprecation] CookieSyncManager in android.webkit has been deprecated
import android.webkit.CookieSyncManager;
                     ^
flutter_inappwebview_android-1.2.0-beta.2\android\src\main\java\com\pichillilorenzo\flutter_inappwebview_android\chrome_custom_tabs\ChromeCustomTabsActivity.java:105: warning: [deprecation] getSerializable(String) in Bundle has been deprecated
    initialHeaders = (Map<String, String>) b.getSerializable("headers");
                                            ^
flutter_inappwebview_android-1.2.0-beta.2\android\src\main\java\com\pichillilorenzo\flutter_inappwebview_android\chrome_custom_tabs\ChromeCustomTabsActivity.java:105: warning: [unchecked] unchecked cast
    initialHeaders = (Map<String, String>) b.getSerializable("headers");
                                                            ^
  required: Map<String,String>
  found:    Serializable
flutter_inappwebview_android-1.2.0-beta.2\android\src\main\java\com\pichillilorenzo\flutter_inappwebview_android\chrome_custom_tabs\ChromeCustomTabsActivity.java:110: warning: [deprecation] getSerializable(String) in Bundle has been deprecated
    customSettings.parse((HashMap<String, Object>) b.getSerializable("settings"));
                                                    ^
flutter_inappwebview_android-1.2.0-beta.2\android\src\main\java\com\pichillilorenzo\flutter_inappwebview_android\chrome_custom_tabs\ChromeCustomTabsActivity.java:110: warning: [unchecked] unchecked cast
    customSettings.parse((HashMap<String, Object>) b.getSerializable("settings"));
                                                                    ^
  required: HashMap<String,Object>
  found:    Serializable
...

Expected Behavior

The plugin is not compatible with java 17 and newer versions

Steps with code example to reproduce

Steps with code example to reproduce
// Paste your code here

Stacktrace/Logs

Stacktrace/Logs
<Replace this line by pasting your stacktrace or logs here>

Flutter version

v3.32.0

Operating System, Device-specific and/or Tool

Android 35

Plugin version

^6.2.0-beta.2

Additional information

No response

Self grab

  • I'm ready to work on this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions