bpillon / google_maps_cluster_manager

Simple Flutter clustering library for Google Maps
https://pub.dev/packages/google_maps_cluster_manager
MIT License
121 stars 94 forks source link

Newer version has some multiple import variable issue with latest version of flutter #58

Open navneetdhameliya opened 4 months ago

navneetdhameliya commented 4 months ago

Screenshot 2024-03-01 at 3 40 07 PM

When I update my flutter version and run application this issue come

derdmislav commented 4 months ago

We are also experiencing the same problem. google_maps_flutter_platform_interface 2.6.0 brought in changes and because google_maps_cluster_manager takes the newest 2.x.x version of google_maps_flutter_platform_interface dependency the issue is created.

Quickest fix would be to add google_maps_flutter_platform_interface in your project as direct dependency and set it to 2.4.3 version

BrijalKothari commented 4 months ago

I got the same issue with both version 3.1.0 and 3.0.0+1. Can you provide a solution?

RoarGronmo commented 4 months ago

The pub-score dropped by 50 because of this issue. Should be fixed as soon as possible.

RoarGronmo commented 4 months ago

I got the same issue with both version 3.1.0 and 3.0.0+1. Can you provide a solution?

As @derdmislav said above:

Pin it in your pubspec.yaml file until resolved

  #---Google maps
  google_maps_flutter: ^2.1.12
  google_maps_flutter_web: ^0.5.0+1
  google_maps_cluster_manager: ^3.0.0+1

  google_maps_flutter_platform_interface: 2.4.3        #<-- set the version without '^'

  google_static_maps_controller: ^1.0.0
  flutter_google_street_view: ^3.0.0
  pointer_interceptor: ^0.10.0
  maps_toolkit: ^3.0.0
BrijalKothari commented 4 months ago

Thanks, it's working@RoarGronmo

RoarGronmo commented 3 months ago

Reason seem to be related to this / theese new functions in google_maps_flutter: https://github.com/flutter/packages/pull/6158 They are adding functions to have clustering "out of the box" in google_maps_flutter.

FaisalMohammadi commented 3 months ago

i get this error as well since i updated my flutter to the latest 3.19.3 and i added the package as @RoarGronmo mentioned but still didnt work.

RoarGronmo commented 3 months ago

Did you remember to "pin" the version ?

--Omit the '^' sign in the version.

RoarGronmo commented 3 months ago

i get this error as well since i updated my flutter to the latest 3.19.3 and i added the package as @RoarGronmo mentioned but still didnt work.

You may have set the version of google_maps_cluster_manager library to ^3.1.0

It is breaking because google_maps_cluster_manager: ^3.1.0 is dependent on: 2.4.3 of google_maps_flutter_platform_interface.

Error when pinning 2.4.1 on google_maps_flutter_platform_interface and setting ^3.1.0 on google_maps_cluster_manager when running flutter pub get:

Because m_office depends on google_maps_cluster_manager ^3.1.0 which depends on google_maps_flutter_platform_interface ^2.4.3, google_maps_flutter_platform_interface ^2.4.3 is required.
So, because m_office depends on google_maps_flutter_platform_interface 2.4.1, version solving failed.

You can try one of the following suggestions to make the pubspec resolve:
* Try upgrading your constraint on google_maps_flutter_platform_interface: flutter pub add google_maps_flutter_platform_interface:^2.6.0
* Consider downgrading your constraint on google_maps_cluster_manager: flutter pub add google_maps_cluster_manager:'^3.0.0+1'

Even the solution suggests to rise the google_maps_flutter_platform_interface to ^2.6.0 it may resolve, but it will fail during build...:Error: 'Cluster' is imported from both 'package:google_maps_cluster_manager/src/cluster.dart' and 'package:google_maps_flutter_platform_interface/src/types/cluster.dart'.

So pin your google_maps_flutter_platform_interface to 2.4.1 and set your google_maps_cluster_manager to ^3.0.0+1 to let it compile. Anyway, you may be victim of "dependency hog" until resolved then...

RoarGronmo commented 2 months ago

Just adding this comment

https://github.com/bpillon/google_maps_cluster_manager/pull/59#issuecomment-2016971082

for a swifter intermediate solution