Can't load Baspemaps and Operational Layer on a MapView control Xamarin.Forms when UWP project is in Release Mode.
I'm developing an Xamarin.Forms mapping app to Android and UWP Platforms using ESRI ArcGISRuntime SDK .NET 100.0 . As part of the workflow the app loads a basemap and a lot of different operational layers based on ArcGIS Tiled and Dynamic Map Services. At almost all development time I wrote and tested code in Debug mode of Visual Studio 2017 and everything went right. But as part of testing time I made a Release apk and appx files to tester teams. The testers of Android version reported that installations went OK, but Windows 10 and Windows 10 Mobile testers reported that basemaps and operational layers did not load. Then I tested inside Visual Studio launching the UWP project in Release mode and I realized that it was true. On the other hand, to upload the application packages to the stores (Play Store and Windows Store) the app must me compiled in Release mode.
The complete solution is published at github in this address: https://github.com/marceloctorres/MapTest.
Someone can help me to find the solution or at least a workaround? I would appreciate it.
The .NET Native toolchain is a little tricky, as it strips out quite a lot of type information if it doesn't know any better.
Make sure you use the Xamarin.Forms MapView, and not the native Controls.UI.MapView control (it can actually be any type inside the specific assembly, since it's really just the assembly we need a reference to).
(Our included Forms project template also includes this call, but when starting from scratch you have to include it yourself).
Thanks, this solves my problem. I had tried that solution but adding the MapView of the wrong namespace.
Funny. I made the same mistake the first time too :-) I wish there was a way we could hide the native MapView control when using Forms to avoid this confusion, but AFAIK that can't be done (the Xamarin.Forms MapView control actually uses the native MapView control internally, so it's really just a cross-platform wrapper for all the different platform controls).