Morten Nielsen Michael Branscomb
We were seeing this problem with runtime version 100.5 (the basemaps loading slowly, or sometimes failing to load at all after zooming in or panning), but only on Android. Ours is a Xamarin.Forms application and performance on UWP and iOS has been fine.
When we changed the HttpClient setting from Managed to Android Native, the basemap loading performance stabilized and never seems to hang. However, we have an error handler catching all unhandled task exceptions and logging them. When you zoom in or pan, the error below occurs repeatedly on Android. We commented out most of our code that's adding layers, so it's basically just displaying a basemap and we're still seeing the errors. So we're kind of stuck since I don't know any way of trapping or handling these errors. We get the performance hiccups when using Managed code, but the errors when using the Android native HttpClient. Any suggestions?
The error:
Unhandled Exception: Observed = True: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> Java.IO.IOException: Canceled
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <286213b9e14c442ba8d8d94cc9dbec8e>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <286213b9e14c442ba8d8d94cc9dbec8e>:0
at Java.Net.HttpURLConnection.get_ResponseCode () [0x0000a] in <95d915721ad748108ff096dce8f8f32c>:0
at Xamarin.Android.Net.AndroidClientHandler+<>c__DisplayClass45_0.<DoProcessRequest>b__1 () [0x00000] in <95d915721ad748108ff096dce8f8f32c>:0
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
at System.Threading.Tasks.Task.Execute () [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
--- End of stack trace from previous location where exception was thrown ---
at Xamarin.Android.Net.AndroidClientHandler+<DoProcessRequest>d__45.MoveNext () [0x0036c] in <95d915721ad748108ff096dce8f8f32c>:0
--- End of stack trace from previous location where exception was thrown ---
at Xamarin.Android.Net.AndroidClientHandler+<SendAsync>d__40.MoveNext () [0x00230] in <95d915721ad748108ff096dce8f8f32c>:0
--- End of inner exception stack trace ---
---> (Inner Exception #0) Java.IO.IOException: Canceled
at Java.Interop.JniEnvironment+InstanceMethods.CallIntMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <286213b9e14c442ba8d8d94cc9dbec8e>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <286213b9e14c442ba8d8d94cc9dbec8e>:0
at Java.Net.HttpURLConnection.get_ResponseCode () [0x0000a] in <95d915721ad748108ff096dce8f8f32c>:0
at Xamarin.Android.Net.AndroidClientHandler+<>c__DisplayClass45_0.<DoProcessRequest>b__1 () [0x00000] in <95d915721ad748108ff096dce8f8f32c>:0
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
at System.Threading.Tasks.Task.Execute () [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0
--- End of stack trace from previous location where exception was thrown ---
at Xamarin.Android.Net.AndroidClientHandler+<DoProcessRequest>d__45.MoveNext () [0x0036c] in <95d915721ad748108ff096dce8f8f32c>:0
--- End of stack trace from previous location where exception was thrown ---
at Xamarin.Android.Net.AndroidClientHandler+<SendAsync>d__40.MoveNext () [0x00230] in <95d915721ad748108ff096dce8f8f32c>:0 <---