fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
https://pub.dev/packages/flutter_webview_plugin
Other
1.48k stars 929 forks source link

The plugin `flutter_webview_plugin` uses a deprecated version of the Android embedding #921

Open andre-paraense opened 2 years ago

andre-paraense commented 2 years ago

System info

Issue occurs on: both Plugin version: 0.4.0 Flutter doctor output:

$ flutter doctor -v
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.5.2 20G95 darwin-x64,
    locale en-GB)
    • Flutter version 2.5.0 at /Users/andre.paraense/Projects/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cc385b4b8 (5 days ago), 2021-09-07 23:01:49
      -0700
    • Engine revision f0826da7ef
    • Dart version 2.14.0

[✓] Android toolchain - develop for Android devices (Android SDK
    version 30.0.0-rc2)
    • Android SDK at /Users/andre.paraense/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0-rc2
    • ANDROID_HOME = /Users/andre.paraense/Library/Android
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.11.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google
      Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      11.0.10+0-b96-7281165)

[✓] VS Code (version 1.60.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flu
      tter

[✓] Connected device (3 available)
    • sdk gphone x86 (mobile)    • emulator-5554
      • android-x86    • Android 11 (API 30) (emulator)
    • iPhone 12 Pro Max (mobile) • C86AC201-D1ED-41A5-ADBA-A2F609200150
      • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-5
      (simulator)
    • Chrome (web)               • chrome
      • web-javascript • Google Chrome 93.0.4577.63

• No issues found!

Steps to Reproduce

Just run any application using flutter_webview_plugin version 0.4.0 after upgrading to Flutter 2.5 and you will get the warning message.

Logs

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 plugin author, take a look at the docs for migrating the plugin
to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Malkeet12 commented 2 years ago

I am also facing the same issue

kolhozz commented 2 years ago

me too

Horace7 commented 2 years ago

I have the same issue

hussamDana92 commented 2 years ago

I have the same issue, any update?

ken-ng-esotec commented 2 years ago

I'm facing the same issue

andreylubnin commented 2 years ago

I'm facing the same issue

Stephane99 commented 2 years ago

Idem

ahaneef29 commented 2 years ago

Any work around ?

Stephane99 commented 2 years ago

This plugin needs to be updated use the V2 embedding method described here: https://flutter.dev/go/android-plugin-migration

StarTakko commented 2 years ago

Same issue

AndrewPalet commented 2 years ago

Would downgrading my Flutter and Dart versions resolve this issue? Has anyone else tried this?

adityatamhane commented 2 years ago

The same issue when I upgrade flutter to 2.5 whereas on the old version it's working

NaarGes commented 2 years ago

I'm facing same issue with flutter 2.5

lyf571321556 commented 2 years ago

same issue

Valien-zhang commented 2 years ago

same issue

z244370114 commented 2 years ago

same issue

DK3369 commented 2 years ago

same issue

imasubmarine commented 2 years ago

same issue

tony123S commented 2 years ago

pls fix

selvas1998 commented 2 years ago

I am also facing same issue with flutter 2.5.

pablogalve commented 2 years ago

I'm also facing the same issue. When can we expect an update?

faslurrajah commented 2 years ago

Works with 2.2.3 Not with 2.5

mustafa-707 commented 2 years ago

same here

zakarianekal commented 2 years ago

need update with fix

Nabouste commented 2 years ago

is there any plan for update devs?

or is there know any other package who can provide ssl error & onurlchanged?

kapil708 commented 2 years ago

tyr this

dependencies:
  flutter_webview_plugin:
    git: https://github.com/nuc134r/flutter_webview_plugin.git
ahmed-foulad20 commented 2 years ago

tyr this

dependencies:
  flutter_webview_plugin:
    git: https://github.com/nuc134r/flutter_webview_plugin.git

can you please explain how to fix this , because i have same issue with other packages

jeisoncf9 commented 2 years ago

I also faced this problem, precisely when I resumed a flutter 2.4.0 project, apparently the plugin there is no compatibility with version 2.5.0. When running the flutter pub get command I received the error and I was able to solve it by running

flutter downgrade

This command returns flutter to version 2.2.1, which allows working with flutter_webview_plugin without problems.

When you need to work with the latest version of Flutter, you can run the flutter upgrade command and you will have the latest version instantly.

I hope this is also helpful while the package's developers solve the root problem.

LakshanFernando commented 2 years ago

Same Issue. 😟 Is there any solution to fix this issue without downgrading the Flutter version?

try this

dependencies:
  flutter_webview_plugin:
    git: https://github.com/nuc134r/flutter_webview_plugin.git

When I try as above mentioned way, the Issue did not occur. but what is the logic behind this?

ipavlyk-startupsoft commented 2 years ago

Same Issue. 😟 Is there any solution to fix this issue without downgrading the Flutter version?

try this

dependencies:
  flutter_webview_plugin:
    git: https://github.com/nuc134r/flutter_webview_plugin.git

When I try as above mentioned way, the Issue did not occur. but what is the logic behind this?

https://github.com/nuc134r/flutter_webview_plugin/commit/f85db45aedefeab4c1df75cfc4c35f62d3c1c629

RoarGronmo commented 2 years ago

@ipavlyk-startupsoft Same issue, but the solution above does not resolve when aad_oauth requires version 0.4.0...

;(

kolhozz commented 2 years ago

just replace this legacy plugin with another one webview_flutter

TesteurManiak commented 2 years ago

just replace this legacy plugin with another one webview_flutter

While the plugin is legacy webview_flutter does not provide all the features from this package. Such as an easy way to listen to url changes for example.

kolhozz commented 2 years ago

just replace this legacy plugin with another one webview_flutter

While the plugin is legacy webview_flutter does not provide all the features from this package. Such as an easy way to listen to url changes for example.

WebView(
initialUrl: widget.url,
javascriptMode: JavascriptMode.unrestricted,
navigationDelegate: (navigation) {
// check link here
return widget.webViewState.onCatchUrl(navigation.url);
},
onPageFinished: (url) {
setState(() {
this._loaded = true;
});
},
),
TesteurManiak commented 2 years ago
WebView(
  initialUrl: widget.url,
  javascriptMode: JavascriptMode.unrestricted,
  navigationDelegate: (navigation) {
    // check link here
    return widget.webViewState.onCatchUrl(navigation.url);
    },
    onPageFinished: (url) {
      setState(() {
        this._loaded = true;
      });
    },
),

This is not a listener it is a delegate, this method is called before navigating to the url, while the listener onUrlChanged provided by this package would be called after the navigation. Might not make a huge difference most of the time but in a project I am working on this is important.

mohitfindoriya commented 2 years ago

tyr this

dependencies:
  flutter_webview_plugin:
    git: https://github.com/nuc134r/flutter_webview_plugin.git

thanks man but can you explain how did you do this

cetusdev commented 2 years ago

tyr this

dependencies:
  flutter_webview_plugin:
    git: https://github.com/nuc134r/flutter_webview_plugin.git

thanks man but can you explain how did you do this hi, i had same issue try to replace flutter_webview_plugin: ^0.4.0 with:

flutter_webview_plugin: git: https://github.com/nuc134r/flutter_webview_plugin.git

in list of dependencies in the pubspec.yaml

zaurdev commented 2 years ago

please fix this bug: The plugin flutter_webview_plugin uses a deprecated version of the Android embedding.

snoopdoggy322 commented 2 years ago

To support null safety, I created a fork with migration 0.4.0 version of the plugin on Android embedding v2. You can use it like :

  flutter_webview_plugin:
    git: https://github.com/snoopdoggy322/flutter_webview_plugin
TesteurManiak commented 2 years ago

@snoopdoggy322 thank you, the warning is gone but the url listener seems like it is not working anymore. (or this might also be the method to close the webview)

luvishq commented 2 years ago

Any updates on this ? There is no update on this plugin since the past 7 months, is anyone working on this plugin ?

marcusrohden commented 2 years ago

Hi, any updates on this issue? Thank you!

sameh-khemira commented 2 years ago

facing the same problem

mbieng91 commented 2 years ago

still have a problem

sahmed-uas commented 2 years ago

@RoarGronmo did you able to resolve this issue? if yes pls share how did you resolved, thanks in advance

RoarGronmo commented 2 years ago

@sahmed-uas no, we haven't

Patelparth2442 commented 2 years ago

tyr this

dependencies:
  flutter_webview_plugin:
    git: https://github.com/nuc134r/flutter_webview_plugin.git

my savior -)

RoarGronmo commented 2 years ago

@Patelparth2442 I got this error when using nuc134r approach...

Because aad_oauth 0.3.0 depends on flutter_webview_plugin ^0.4.0 and no versions of aad_oauth match >0.3.0 <0.4.0, aad_oauth ^0.3.0 requires flutter_webview_plugin from hosted.
So, because mwork depends on both aad_oauth ^0.3.0 and flutter_webview_plugin from git, version solving failed.
pub get failed (1; So, because mwork depends on both aad_oauth ^0.3.0 and flutter_webview_plugin from git, version solving failed.)

Still stuck here, maybe I need to search further down the line...

Patelparth2442 commented 2 years ago

@Patelparth2442 I got this error when using nuc134r approach...

Because aad_oauth 0.3.0 depends on flutter_webview_plugin ^0.4.0 and no versions of aad_oauth match >0.3.0 <0.4.0, aad_oauth ^0.3.0 requires flutter_webview_plugin from hosted.
So, because mwork depends on both aad_oauth ^0.3.0 and flutter_webview_plugin from git, version solving failed.
pub get failed (1; So, because mwork depends on both aad_oauth ^0.3.0 and flutter_webview_plugin from git, version solving failed.)

Still stuck here, maybe I need to search further down the line...

try to use downgrade version for both aad_oauth ^0.2.2 and flutter_webview_plugin 0.3.11

zitob9 commented 2 years ago

@snoopdoggy322 thanks for your help, I have a problem with listing for onProgressChanged, or onUrlChanged doesn't work anymore after using your update