I created cross-platform xamarin portable class library (PCL) solution in visual studio 2017 enterprise and added nuget package: Xamarin.Forms.Maps (version 2.3.3.193) which matches built-in Xamarin.Forms version so the project builds and runs successfully without any error but throws an exceptionException and these are the "copied details" : "An unhandled exception occured. occurred" Following is the code which raises exception while running the project inside android 6.0 (x86) emulator or phone (android 4.4):
<maps:Map x:Name="LocationsMap" HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
inside the content page (MapPage.xaml):
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TravelRecordApp.MapPage"
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps">
<maps:Map x:Name="LocationsMap" HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
I am currently running xamarin.Forms and Xamarin.Forms.Maps (both version 2.3.3.193 ) and Xamarin.GooglePlayServices.Maps (29.0.0.1) and when i update xamarin.Forms and Xamarin.Forms to v3.1.0.697729 or Xamarin.GooglePlayServices.Maps to v60.11 (the latest stable releases) it results in lots of errors and project can't be built so i keep default versions (v2.3.3.193) and (v29.0.0.1). i have included API key in the Manifest file from "Maps SDK for android" and these are permissions:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission
android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="API_KEY" />
<application android:label="TravelRecordApp.Android"></application>
</manifest>