Xamarin for Visual Studio Upgrade Issue

1360
2
04-05-2017 12:16 PM
AndyWright
Occasional Contributor

I just upgraded Xamarin for Visual Studio to all the latest versions and now my Runtime app fails with the following error.  The part in bold leads me to believe the current version of the Runtime API does not support the latest Xamarin for Visual Studio bits.  Can someone from Esri confirm that and let me know the best way to rollback?  I didn't see anything on your System Requirements page concerning this stuff.  Here's what I have now:

Xamarin - 4.3.0.7905

Xamarin.Android - 7.1.0.43

Xamarin iOS - 10.6.0.9

Here's what I had prior to the upgrade:

Xamarin - 4.1.1.3

Xamarin.Android - 6.1.1.1

Xamarin.iOS - 9.8.1.4

{System.MissingMethodException: Default constructor not found for type Esri.ArcGISRuntime.Xamarin.Forms.MapView
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00085] in /Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:171
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0001a] in /Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:153
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0002a] in /Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/class/referencesource/mscorlib/system/rttype.cs:5638
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00040] in /Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/class/referencesource/mscorlib/system/activator.cs:201
at System.Activator.CreateInstance (System.Type type) [0x00000] in /Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/class/referencesource/mscorlib/system/activator.cs:134
at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x0021f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:97
at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000b1] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlNode.cs:176
at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00089] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlNode.cs:173
at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00089] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlNode.cs:226
at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydratationContext visitorContext) [0x00053] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlLoader.cs:122
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml) [0x00046] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlLoader.cs:76
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.Type callingType) [0x0002f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlLoader.cs:56
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.Type callingType) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\ViewExtensions.cs:36
at EFCloud.MapPage.InitializeComponent () [0x00001] in C:\Epoch\ESG_Products\EpochFieldCloud\EFCloud\EFCloud.Android\obj\Debug\EFCloud.MapPage.xaml.g.cs:45
at EFCloud.MapPage..ctor () [0x0002d] in C:\Epoch\ESG_Products\EpochFieldCloud\EFCloud\EFCloud.Shared\MapPage.xaml.cs:51
at EFCloud.App..ctor () [0x00047] in C:\Epoch\ESG_Products\EpochFieldCloud\EFCloud\EFCloud.Shared\App.xaml.cs:95 }

0 Kudos
2 Replies
PreetiMaske
Esri Contributor

Few options to try before rolling back :

- Try deleting the build directory on the Mac as well. You should find that at 

/users/<user>/library/caches/xamarin/mtbs/builds/<app name>.

- Try adding [assembly: XamlCompilation(XamlCompilationOptions.Compile)] to Assemblyinfo.cs in Xamarin Forms iOS project. Xamarin Forms build will exclude referenced libraries unless they're used in code or otherwise explicitly preserved.

0 Kudos
AndyWright
Occasional Contributor

Hi Preeti,

Thanks for the response.  Sorry for the delay getting back to you, I was out of the office.  So I went ahead and created a brand new Runtime project and that worked fine, so this is definitely not an incompatibility issue between the Runtime API and the new Xamarin bits.  It now points to some needle in the haystack of our code, so I'll be focusing my efforts there.  Sorry for the false alarm ...

0 Kudos