fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.

Home Page:https://pub.dev/packages/flutter_webview_plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

this plugin is deprecated and use plugin migration

uday-tatamd opened this issue · 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.

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

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 I try used to fork but it problem persist
image

@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

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

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)

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);

#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!