flutter_webview_plugin icon indicating copy to clipboard operation
flutter_webview_plugin copied to clipboard

this plugin is deprecated and use plugin migration

Open uday-tatamd opened this issue 2 years ago • 8 comments

The plugin flutter_webview_plugin uses a deprecated version of the Android embedding. To avoid unexpected runtime failures or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs. If you are a plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

uday-tatamd avatar Feb 08 '23 10:02 uday-tatamd

i am also facing the same issue , please help me to get out of this error

uday-tatamd avatar Feb 23 '23 11:02 uday-tatamd

You can use one of forked branches that fixed this problem. One of them is mine: https://github.com/Antwen97/flutter_webview_plugin_V2

Like me, also others made same fix. Until a future merge, you can use forks typing (obviusly, indent code in the pubspec.yaml): flutter_webview_plugin: git: url: GITHUB_FORK_URL

Just change "GITHUB_FORK_URL" with the url you choose that implements the android V2 migration. In alternative, you can create your own fork and make the migration by yourself

Antwen97 avatar Mar 15 '23 09:03 Antwen97

@Antwen97 I try used to fork but it problem persist image

Laraveloper20 avatar Mar 16 '23 17:03 Laraveloper20

@Antwen97 I try used to fork but it problem persist image

Which compiled and target SDK version you are using? I solved the problem just replacing the plugin version with the GitHub URL, clean and get

Antwen97 avatar Mar 16 '23 18:03 Antwen97

build.gradle minSdkVersion 20 targetSdkVersion 33 In pubspec.yaml I got this flutter_webview_plugin: git: url: https://github.com/Antwen97/flutter_webview_plugin_V2 ref: master I'm using ❯ flutter --version Flutter 3.7.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision c07f788888 (3 weeks ago) • 2023-02-22 17:52:33 -0600 Engine • revision 0f359063c4 Tools • Dart 2.19.2 • DevTools 2.20.1

Laraveloper20 avatar Mar 16 '23 20:03 Laraveloper20

In the process of working on the Flutter app project, I applied this plugin, and I confirmed that this plugin is currently using an android v1 embedding method that has been discontinued.

I forked the repository and completed the migration with an Android v2 embedding scheme, and I found my project no longer has relevant warnings. Of course, it works fine!

If you guys are having the same problem as me, check my repository that completed the migration.

How to apply it is very simple! You just need to write a few extra lines of code in pubspec.yaml.

dependencies:
    flutter_wbview_plugin:
        git:
            url: https://github.com/hardy716/flutter_webview_plugin.git

Please let me know if it doesn't apply or if an error occurs.

https://github.com/fluttercommunity/flutter_webview_plugin/pull/962#issue-1667425531

hardy716 avatar Apr 14 '23 03:04 hardy716

In the process of working on the Flutter app project, I applied this plugin, and I confirmed that this plugin is currently using an android v1 embedding method that has been discontinued.

I forked the repository and completed the migration with an Android v2 embedding scheme, and I found my project no longer has relevant warnings. Of course, it works fine!

If you guys are having the same problem as me, check my repository that completed the migration.

How to apply it is very simple! You just need to write a few extra lines of code in pubspec.yaml.

dependencies:
    flutter_wbview_plugin:
        git:
            url: https://github.com/hardy716/flutter_webview_plugin.git

Please let me know if it doesn't apply or if an error occurs.

#962 (comment) i have targetSdkVersion 33 and getting this error error: cannot find symbol webView.getSettings().setAppCacheEnabled(appCacheEnabled);

Louna-akkad1 avatar May 16 '23 07:05 Louna-akkad1

#962 (comment) i have targetSdkVersion 33 and getting this error error: cannot find symbol webView.getSettings().setAppCacheEnabled(appCacheEnabled);

Hi. I corrected the part that might be problematic in relation to what you said. Check back and let me know if the problem persists!

hardy716 avatar May 18 '23 06:05 hardy716