Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google map in flutter doesn't appear

I'm trying to follow this tutorial "https://medium.com/flutter-io/google-maps-and-flutter-cfb330f9a245" to add google map in flutter. I updated android manifest with google map key and added a permission for accessing fine_location.I get white screen on my emulator with no map. i spent many hours trying to fix it but in vain . i also tried the sample usage with plugin "https://pub.dartlang.org/packages/google_maps_flutter#-readme-tab-" but nothing help in showing map . any help is appreciated thanks in advance

like image 727
Fatima Hossny Avatar asked Mar 30 '19 11:03

Fatima Hossny


2 Answers

after a day of searching for solutions, I found that I had added the wrong api key. so double check your api key before build the apk;

I have added my android api key in ios.

like image 58
Prashant Vaddoriya Avatar answered Sep 18 '22 14:09

Prashant Vaddoriya


After creating an API you should enable Android SDK and IOS SDK for your project. After you did that, go to API restrictions and select these two. Please see the following images:

  1. Enable SDK's: Enable SDK's

  2. Add them to the API restrictions This how they should look like if they are enabled

And you are done! All you need to do right now is to copy the API key and add it into your AndroidManifest file. Also keep in mind that you don't actually need to add a billing account for this to work. Hope this works for you!

like image 45
Andreea Purta Avatar answered Sep 20 '22 14:09

Andreea Purta