We have been trying to put the basic .net sample on the Leica Zeno 20 UMTS having android Android 4.2.2.
Trying to open a simple "Display Map" page....gives this error.
System.NotSupportedException: Could not activate JNI Handle 0x2b00025 (key_handle 0x4113f7e8) of Java type 'md525ae7a30145b6936c079fc7426298397/DisplayMap' as managed type 'ArcGISRuntimeXamarin.Samples.DisplayMap.DisplayMap'.
We have even tried on the emulator with android 4.2.2.
Any help would be appreciated!
Solved! Go to Solution.
OK I tracked down the bug, and will manifests itself on devices at API Level 16 and Level 17 (ie v4.2 and down).
Luckily I have a workaround for you. In the Application constructor add the following line:
Let me know if that works for you or not.
Android 4.2.2 is currently supported with ArcGIS Runtime SDK for .NET v100.2.1. For that error, it sounds like you might be running into Could not activate JNI Handle — Xamarin Forums ?
Note the next release of ArcGIS Runtime SDK for .NET will increase the minimum required Android version to API level 19 / 4.4. For more information see Release notes for 100.2.1—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers
There's nothing that stands out to be wrong with the app from my first look. Do you see a similar issue when using the native android version? (it not Xamarin.Forms) ?
Thank you Morten, i can give it a try.
But that would not help us much. Since, our app has been developed using Xamarin and Leica Zeno 20 UMTS is one of those devices which plan to use it on.
First I was trying to trouble-shoot, and figure out if the issue is isolate to Xamarin.Forms for Android, or also exist in Xamarin.Android.
Both will be able to run just fine on an Android device (Forms is just an extension of Xamarin.Android). In fact if you're only targeting Android and not building a cross-platform app, I'd recommend using the native UI stack instead of Forms, as you should see faster load times and more control of the UI.
Hi Again Morten,
Let me try to summarize what works and what does not.
Xamarin.Forms.Android (Android API 17, 4.2.2 with custom/esri.github xamarin sample)---Crashes
Xamarin.Forms.Android (Android API 23, with custom/esri.github xamarin sample)---Works
Xamarin.Android (Android API 17, 4.2.2 with custom/esri.github xamarin sample)---Crashes
Xamarin.Android (Android API 23, with custom/esri.github xamarin sample)---Works
We already have an app created using xamarin forms and works nicely on android and ios, except for the above mentioned leica device, just for fun i tried installing the collector app in the leica device and works like a charm. So now, i am not sure what could be going wrong here....
Would prefer, if you could try out a simple test using the 4.2 SDK and if it works do send me the code, then i can drill further.
Regarding your suggestion on the faster loading & UI, we have already done quite a lot of work on the forms and is relatively stable on the both the platforms.
For the mapping part we have a single instance of the mapview with snapshot of the operational layers.....once this is loaded for the first time, this object gets attached/detached in different layouts..which considerably reduces the load time on each pages.
Thank you. That's very helpful. Collector is relying on the same native bits but isn't built on Xamarin. That seems to indicate the issue is with either Microsoft's Xamarin or our Runtime Xamarin bits. We'll dig more into reproducing.
Which emulator were you using?