Home > Net >  Flutter, google_maps_flutter and webview_flutter are not match
Flutter, google_maps_flutter and webview_flutter are not match

Time:02-20

i have webview_flutter: ^2.8.0 in my pubspec.yaml then i want to add google_maps_flutter: ^1.2.0 package but it doesn't match, can it be fix? or what other package to replace google_maps_flutter: ^1.2.0 because this is my company project and webview_flutter: ^2.8.0 is already in the pubspec.yaml from the beginning and i cannot remove it of course.

it shows something like this in output

Running "flutter pub get" in one-smile...                       
Because no versions of webview_flutter_platform_interface match >1.8.0 <1.8.1 and webview_flutter_platform_interface >=1.8.1 depends on plugin_platform_interface ^2.1.0, webview_flutter_platform_interface >1.8.0 requires plugin_platform_interface ^2.1.0.
And because webview_flutter_platform_interface 1.8.0 depends on plugin_platform_interface ^2.0.0, webview_flutter_platform_interface >=1.8.0 requires plugin_platform_interface ^2.0.0.
Because google_maps_flutter >=1.2.0 <2.0.0-nullsafety depends on google_maps_flutter_platform_interface ^1.2.0 which depends on plugin_platform_interface ^1.0.1, google_maps_flutter >=1.2.0 <2.0.0-nullsafety requires plugin_platform_interface ^1.0.1.
Thus, google_maps_flutter >=1.2.0 <2.0.0-nullsafety is incompatible with webview_flutter_platform_interface >=1.8.0.
And because webview_flutter 2.8.0 depends on webview_flutter_platform_interface ^1.8.0 and no versions of webview_flutter match >2.8.0 <3.0.0, google_maps_flutter >=1.2.0 <2.0.0-nullsafety is incompatible with webview_flutter ^2.8.0.
So, because onesmile depends on both webview_flutter ^2.8.0 and google_maps_flutter ^1.2.0, version solving failed.
pub get failed (1; So, because onesmile depends on both webview_flutter ^2.8.0 and google_maps_flutter ^1.2.0, version solving failed.)
exit code 1

and in debug console when i run it

Because no versions of webview_flutter_platform_interface match >1.8.0 <1.8.1 and webview_flutter_platform_interface >=1.8.1 depends on plugin_platform_interface ^2.1.0, webview_flutter_platform_interface >1.8.0 requires plugin_platform_interface ^2.1.0.
And because webview_flutter_platform_interface 1.8.0 depends on plugin_platform_interface ^2.0.0, webview_flutter_platform_interface >=1.8.0 requires plugin_platform_interface ^2.0.0.
Because google_maps_flutter >=1.2.0 <2.0.0-nullsafety depends on google_maps_flutter_platform_interface ^1.2.0 which depends on plugin_platform_interface ^1.0.1, google_maps_flutter >=1.2.0 <2.0.0-nullsafety requires plugin_platform_interface ^1.0.1.
Thus, google_maps_flutter >=1.2.0 <2.0.0-nullsafety is incompatible with webview_flutter_platform_interface >=1.8.0.
And because webview_flutter 2.8.0 depends on webview_flutter_platform_interface ^1.8.0 and no versions of webview_flutter match >2.8.0 <3.0.0, google_maps_flutter >=1.2.0 <2.0.0-nullsafety is incompatible with webview_flutter ^2.8.0.
So, because onesmile depends on both webview_flutter ^2.8.0 and google_maps_flutter ^1.2.0, version solving failed.
pub get failed (1; So, because onesmile depends on both webview_flutter ^2.8.0 and google_maps_flutter ^1.2.0, version solving failed.)

CodePudding user response:

as you can see on pub.dev webview_flutter: ^2.8.0 is nearly two months old uses latest api to interact with flutter.

enter image description here

where your google_maps_flutter: ^1.2.0 is quite old so update it to any of below versions and it should work.

enter image description here

  • Related