1
votes

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>
1
How can you possibly expect us to help you without details of the exception? Please post the full exception along with the stack trace.Chris Dunaway
I can only offer a suggestion, more so if you are in error hell after updating Xamarin: restart Visual Studio and hope the errors offer more sensical info.EdSF
These are the errors when i update xamarin.forms and xamarin.forms.maps: 1. The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly. 2. Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabledsheen
@EdSF So this is your nosebleed level of replying OP i thought some professionals could help.sheen
@sheen I suggested something to try so you can give the community something to go on, which I can see you did (give a more specific exception). Best of luckEdSF

1 Answers

0
votes

After installing .Net Framework 47.2 all issues resolved.here is the link https://support.microsoft.com/en-us/help/4054530/microsoft-net-framework-4-7-2-offline-installer-for-windows

Note: if you are running older version of windows 10 (build 10240) you need to update windows as you can't install .Net Framework 47.2 on it.