I have recently tried to add xamarin.forms.maps to an application. iOS took about 20 minutes. Android, of course, is the problem.
I think I've got the API key specified correctly, restricted as it ought to be, in the Manifest, etc.
<application android:icon="@drawable/ic_launcher" android:debuggable="false" android:theme="@style/MyTheme" android:label="MOVE C&V">
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyB608Ert10EN_pJDlJuGSAhvQDnotreal" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
</application>
I'm getting an error as soon as I try to bring up the page with the map in it.
I just noticed (after typing all this out) that it only happens if IsShowingUser = true. When I set that value to false in the XAML, things work JUST FINE (all caps for the stay up past midnight for bs problem).
There are some errors in the application output that I thought were the source of the problem. Namely
Rejecting re-init on previously-failed class java.lang.Class<mi>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/chimera/Fragment;
and
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.chimera.Fragment"
XAML for the map page is pretty simple as well.
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps"
x:Class="AppNamespace.MapPage"
>
<ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness">
<OnPlatform.iOS>0, 20, 0, 0</OnPlatform.iOS>
<OnPlatform.Android>0, 0, 0, 0</OnPlatform.Android>
<OnPlatform.WinPhone>0, 0, 0, 0</OnPlatform.WinPhone>
</OnPlatform>
</ContentPage.Padding>
<ContentPage.Content>
<StackLayout
VerticalOptions="FillAndExpand"
Padding="10"
Orientation="Vertical"
BackgroundColor="{DynamicResource Background}"
>
<maps:Map
x:Name="mapControl"
IsShowingUser="true"
MapType="Street"
VerticalOptions="FillAndExpand"
/>
<StackLayout
Orientation="Horizontal"
x:Name="stackBack"
BackgroundColor="White"
Padding="10,10,10,10"
Margin="0,10,0,10"
VerticalOptions="End"
>
<Label
x:Name="lblBack"
Text="Back"
HorizontalOptions="CenterAndExpand"
TextColor="{DynamicResource Blue}"
FontSize="22"
VerticalOptions="Center"
FontAttributes="Bold"
/>
<Image
x:Name="imgBack"
Source="{DynamicResource BackArrow}"
WidthRequest="50"
HeightRequest="50"
/>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>
Any help at all is much appreciated.