Issues running a Xamarin.Forms based Runtime app on the emulator

1344
4
02-26-2018 01:11 PM
MichaelHamsa
Occasional Contributor

Hello,

We are in the process of beginning to develop a Xamarin.Forms based app the uses the Esri Runtime. I've done a little testing and I'm having quite a bit of problems debugging and running the app on the Android emulator. When I run the app with the Visual Studio debugger, it crashes right at startup. There are no exceptions, and very little output in the debug log. Here's what Visual Studio reports in the debug output:

02-26 15:02:27.709 D/Mono    (15402): Image addref mscorlib[0xae3040e0] -> mscorlib.dll[0xad02ba00]: 2
02-26 15:02:27.709 D/Mono    (15402): Prepared to set up assembly 'mscorlib' (mscorlib.dll)
02-26 15:02:27.709 D/Mono    (15402): AOT module 'mscorlib.dll.so' not found: dlopen failed: library "/data/app/XamarinEsriMap.Android-1/lib/x86/libaot-mscorlib.dll.so" not found
02-26 15:02:27.710 D/Mono    (15402): AOT module '/Users/builder/data/lanes/4009/f3074d2c/source/monodroid/builds/install/mono-x86/lib/mono/aot-cache/x86/mscorlib.dll.so' not found: dlopen failed: library "/data/app/XamarinEsriMap.Android-1/lib/x86/libaot-mscorlib.dll.so" not found
02-26 15:02:27.711 D/Mono    (15402): Config attempting to parse: 'mscorlib.dll.config'.
02-26 15:02:27.711 D/Mono    (15402): Config attempting to parse: '/Users/builder/data/lanes/4009/f3074d2c/source/monodroid/builds/install/mono-x86/etc/mono/assemblies/mscorlib/mscorlib.config'.
02-26 15:02:27.774 D/Mono    (15402): Assembly mscorlib[0xae3040e0] added to domain RootDomain, ref_count=1

Additionally, when I simply run the app straight from the device emulator, I can zoom in once or twice on the map, then the app crashes.The app is very basic - just a MapView on the MainPage.xaml that loads the Streets basemap.

The emulator is running Android 6.0 (API Level 23) on a 5.7" device. I'm using the Visual Studio Android Emulator image.

I've run these tests with 100.2.0 and 100.2.1 with the same results.

Any assistance would be greatly appreciated.

Mike...

0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor

Are you using a vector tiled map? There's a known issue with the Visual Studio Android emulator and vector basemaps.

Does the app run ok on a device? Will it run ok without the map component? (or if you skip assigning a map to the mapview?)

0 Kudos
MichaelHamsa
Occasional Contributor

Morten,

This was really an emulator issue – changed a build setting and an emulator setting and it seems to be working pretty well. Sorry for the confusion, and thanks for the quick response.

Thanks,

Mike Hamsa

Chief Technology Officer - GeoSpatial Innovations, Inc.

P: 512-982-6735

0 Kudos
dotMorten_esri
Esri Notable Contributor

Great to hear you got it working! In case someone else hits this, do you mind sharing which settings you changed?

0 Kudos
MichaelHamsa
Occasional Contributor

Morten,

Not a problem. I’m using the Visual Studio Android Emulator (I know, probably shouldn’t be). These are actually older Hyper-V virtual machine images. To get it to work correctly while debugging with Visual Studio, I had to make the following changes.

Emulator VM changes

1. Go to the Hyper-V manager

2. Right click on the VM for the emulator you are using and press Settings

3. Open the Processor folder

4. Select Compatibility, and then check ON “migrate to a physical computer with a different processor”

Visual Studio Build Settings

1. In your solution, right click on the Android Project and press properties

2. Go to Android Options

3. Check OFF, Use Fast Deployment.

That pretty much took care of it.

Thanks again,

Mike Hamsa

Chief Technology Officer - GeoSpatial Innovations, Inc.

P: 512-982-6735

0 Kudos