I am running the sample application on android and have put my API key into the Variables.cs for Android. I then run the sample application and click "Basic Map", this shows a Teal coloured grid with Xamarin.Forms.GoogleMaps text in the middle
You should call Xamarin.FormsGoogleMaps.Init in MainActivity.cs, please check it.
@amay077 I am also calling Xamarin.FormsGoogleMaps.Init() in MainActivity.cs.
I have tested on the sample and on my own application. I was wondering if anything had Changed?
To generate my key I followed Step 1 and 2 from here: https://developers.google.com/maps/documentation/android-api/signup
If FormsGoogleMaps.IsInitialized == false then show green view.
You can debug listed codes:
Hmm.. Very strange.
Running the sample application I put the following in MainActivity:
global::Xamarin.Forms.Forms.Init(this, bundle);
Xamarin.FormsGoogleMaps.Init(this, bundle); // initialize for Xamarin.Forms.GoogleMaps
var d = Xamarin.FormsGoogleMaps.IsInitialized;
I put a break point to check the value of d and d= false. This is using 1.8.0-Beta7.
Could initialisation be broken?
I had a similar issue today. I debugged it while checking
if (GooglePlayServicesUtil.IsGooglePlayServicesAvailable(Context) == ConnectionResult.Success) in MainActivity and it returned ServiceVersionUpdateRequired, which lead me to the fact that google play services needed update on the device (it was really old).
I would bet you have the same problem :)
@raver999 Thanks! that was the problem. I had to update Google Play Services on the phone
Most helpful comment
I had a similar issue today. I debugged it while checking
if (GooglePlayServicesUtil.IsGooglePlayServicesAvailable(Context) == ConnectionResult.Success)in MainActivity and it returnedServiceVersionUpdateRequired, which lead me to the fact that google play services needed update on the device (it was really old).I would bet you have the same problem :)