fysoul17 / google_maps_place_picker

Place picker on Google Maps for Flutter
MIT License
222 stars 357 forks source link

Map is not shown #51

Open dhruv048 opened 4 years ago

dhruv048 commented 4 years ago

When i click the button, a white screen appears with textformfield on top and a tiny blue dot in the middle, can you please help me out with that

FadiBasheer commented 4 years ago

I have the same issue, I tried every thing and still not working.

                                                     These are  the first two lines of the errors

MissingPluginException(No implementation found for method checkServiceStatus on channel com.baseflow.flutter/location_permissions) E/flutter ( 6811): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: plugins.flutter.io/google_maps E/flutter ( 6811): at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:97)

fysoul17 commented 4 years ago

By looking at the error message, it sounds like you are using either geolocator or location_permissions package in your project.

This package internally uses geolocator package which has a reference to 'location_permission' package and sounds like it conflicts with each other. You might need to adjust the version of geolocator or location_permission.

FadiBasheer commented 4 years ago

Hi @fysoul17 ,

Thanks for your answer, this is my code and it's a brand new project. I'm just trying to make it work on Android first now.

class _MyHomePageState extends State { static final kInitialPosition = LatLng(49.134738, -123.168055); PickResult selectedPlace;

@override Widget build(BuildContext context) { return Scaffold( body: Center( child: RaisedButton( child: Text('click'), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => PlacePicker( apiKey: "I added my API key here also", initialPosition: kInitialPosition, useCurrentLocation: true, onPlacePicked: (result) { selectedPlace = result; //print("Result: $result"); Navigator.of(context).pop(); }, ), ), ); }, ), ), ); } }

fysoul17 commented 4 years ago

As answered above, I need to know whether you have geolocator or location_permission in your pubspec.yaml. Can you provide whole codes in pubspec.yaml?

FadiBasheer commented 3 years ago

Hi @fysoul17,

Thanks for your answer. I found the problem, I was replacing

meta-data android:name="flutterEm" android:value="2" />

with

meta-data android:name="com.google.android.geo.API_KEY" android:value=" my API key here "/>

rather than just add the new meta-data

fysoul17 commented 3 years ago

@FadiBasheer. Glad you found the solution. ;)