humazed / google_map_location_picker

🌍 Map location picker component for flutter Based on google_maps_flutter
Apache License 2.0
206 stars 309 forks source link

Last Release 4.1.7 Issue when build the project #144

Open SmarterVision opened 3 years ago

SmarterVision commented 3 years ago

When I have built the project I get the following errors Flutter 2.0.1 stable release.

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/google_map_location_picker-4.1.7/lib/src/map.dart:98:17: Error: The method 'getCurrentPosition' isn't defined for the class 'MapPickerState'.
 - 'MapPickerState' is from 'package:google_map_location_picker/src/map.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/google_map_location_picker-4.1.7/lib/src/map.dart').
Try correcting the name to the name of an existing method, or defining a method named 'getCurrentPosition'.
          await getCurrentPosition(desiredAccuracy: widget.desiredAccuracy);
                ^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/google_map_location_picker-4.1.7/lib/src/map.dart:327:37: Error: The method 'checkPermission' isn't defined for the class 'MapPickerState'.
 - 'MapPickerState' is from 'package:google_map_location_picker/src/map.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/google_map_location_picker-4.1.7/lib/src/map.dart').
Try correcting the name to the name of an existing method, or defining a method named 'checkPermission'.
    final geolocationStatus = await checkPermission();
                                    ^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/google_map_location_picker-4.1.7/lib/src/map.dart:402:19: Error: The method 'openAppSettings' isn't defined for the class 'MapPickerState'.
 - 'MapPickerState' is from 'package:google_map_location_picker/src/map.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/google_map_location_picker-4.1.7/lib/src/map.dart').
Try correcting the name to the name of an existing method, or defining a method named 'openAppSettings'.
                  openAppSettings();
                  ^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/google_map_location_picker-4.1.7/lib/src/map.dart:415:17: Error: The method 'isLocationServiceEnabled' isn't defined for the class 'MapPickerState'.
 - 'MapPickerState' is from 'package:google_map_location_picker/src/map.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/google_map_location_picker-4.1.7/lib/src/map.dart').
Try correcting the name to the name of an existing method, or defining a method named 'isLocationServiceEnabled'.
    if (!(await isLocationServiceEnabled())) {
                ^^^^^^^^^^^^^^^^^^^^^^^^
humazed commented 3 years ago

are you using dependencies override? If no could you share a project where I could reproduce this issue?

SmarterVision commented 3 years ago

are you using dependencies override? If no could you share a project where I could reproduce this issue?

Yeah, I use dependencies override because the new firebase_messaging not working with your geolocator version. I have this error.

Because google_map_location_picker 4.1.7 depends on geolocator ^6.1.14 which depends on geolocator_platform_interface ^1.0.8, google_map_location_picker 4.1.7 requires geolocator_platform_interface ^1.0.8.
And because geolocator_platform_interface <2.0.0-nullsafety.0 depends on plugin_platform_interface ^1.0.2 and firebase_messaging_platform_interface 2.0.0 depends on plugin_platform_interface ^2.0.0, google_map_location_picker 4.1.7 is incompatible with firebase_messaging_platform_interface 2.0.0.
Because no versions of firebase_messaging_platform_interface match >2.0.0 <3.0.0 and firebase_messaging 9.0.0 depends on firebase_messaging_platform_interface ^2.0.0, firebase_messaging 9.0.0 requires firebase_messaging_platform_interface 2.0.0.
Thus, google_map_location_picker 4.1.7 is incompatible with firebase_messaging 9.0.0.
So, because **MYAPP** depends on both firebase_messaging 9.0.0 and google_map_location_picker 4.1.7, version solving failed.
pub get failed (1; So, because **MYAPP** depends on both firebase_messaging 9.0.0 and google_map_location_picker 4.1.7, version solving failed.)

My pubspec.yaml

dependency_overrides:
  path_provider: 2.0.1
  geolocator: 7.0.1
humazed commented 3 years ago

unfortunately, geolocator 7.0 has breaking changes and would need to update the lib and do extensive testing, but I don't have much free time currently, so you could try to use old versions of the geolocator until I update it.

eakteam commented 3 years ago

@SmarterVision i'm facing the same issue.

As a temporary fix i am using that to my pubspec.yaml till @humazed will update this lib

google_map_location_picker:
    git:
      url: git://github.com/davemg3/google_map_location_picker.git

And remove that :

dependency_overrides:
  geolocator: 7.0.1