AnsweredAssumed Answered

Default constructor not found for type Esri.ArcGISRuntime.Xamarin.Forms.MapView

Question asked by TylerESRI on Nov 28, 2016
Latest reply on Dec 1, 2016 by TylerESRI

Hi,

 

Using Xamarin Studio on Mac OS X, I created a brand new Xamarin forms project and added the Esri.ArcGISRuntime.Xamarin.Forms and Esri.ArcGISRuntime.Xamarin.iOS packages (both v100.0.0) via NuGet.  Created a simple Xaml page just like the sample:

 

<?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:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms"
xmlns:mapping="clr-namespace:Esri.ArcGISRuntime.Mapping;assembly=Esri.ArcGISRuntime" 
xmlns:local="clr-namespace:EsriTest" 
x:Class="EsriTest.EsriTestPage">
    <Grid>
        <esriUI:MapView x:Name="MyMapView"/>
      </Grid>
</ContentPage>

 

With the code behind:

public partial class EsriTestPage : ContentPage
    {
        public EsriTestPage ()
        {
            InitializeComponent ();
            
            Initialize ();
        }
        
         private void Initialize ()
        {
            // Create new Map with basemap
            Map myMap = new Map(Basemap.CreateImagery());

            // Assign the map to the MapView
            MyMapView.Map = myMap;
        }
    }

 

It compiles and deploys fine to an iPad Air device (iOS 10.1.1), but when I hit this page I get a System.MissingMethodException - Default constructor not found for type Esri.ArcGISRuntime.Xamarin.Forms.MapView:

 

[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
        private void InitializeComponent() {
            this.LoadFromXaml(typeof(EsriTestPage)); // throws exception here
            MyMapView = this.FindByName <global::Esri.ArcGISRuntime.Xamarin.Forms.MapView>("MyMapView");
        }

 

Any help is appreciated... thanks.

Outcomes