100.4 Basemaps aren't loading reliably

1560
9
10-22-2018 07:31 AM
CalebPourchot
New Contributor III

I've recently upgraded to 100.4 for my Xamarin Forms app. Now my map pages are regularly hanging while trying to display basemap tiles. The entire UI freezes while this is happening. When doing an offline tile download, the servers regularly fail with a timeout. It is a crippling problem. Is there anything I can do?

0 Kudos
9 Replies
dotMorten_esri
Esri Notable Contributor

Which platform are you seeing on? (UWP, iOS, Android, which OS version and which device?)

Does the problem go away if you downgrade to 100.3?

0 Kudos
CalebPourchot
New Contributor III

Hi Morten,

iOS and Android. Any number of different devices. It's affecting all of my

users. Interestingly, I had a user also try Collector and it was failing to

load basemaps as well...

I haven't had a chance to try the downgrade yet, but will post again if

that seems to change anything.

Thanks,

Caleb

0 Kudos
CalebPourchot
New Contributor III

I have spent the last couple days trying to narrow down what's happening and i'm not getting very far. It appears that it only happens on Release builds, mostly on Android. However, it will work well for a bit, then suddenly not work. 

I downgraded to 100.3, but as far as I can tell there was no change, so it doesn't appear to be related to 100.4. The small exception may be that I'm not seeing it on iOS release builds anymore. However, it really is hard to tell because of how the problem comes and goes. 

I'm at a loss for how to troubleshoot this. The only output I see in a debug build that may or may not be relevant is this whenever I open the map:

10-26 08:19:02.338 W/OkHttpClient(12489): A connection to https://www.arcgis.com/ was leaked. Did you forget to close a response body?
10-26 08:19:02.338 W/OkHttpClient(12489): A connection to https://static.arcgis.com/ was leaked. Did you forget to close a response body?

Any direction would be appreciated. Thanks.

ChrisPalmer1
New Contributor II

Morten NielsenMichael 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 <---

0 Kudos
CalebPourchot
New Contributor III

FYI - it seems to have started working again just now after not working most of this morning. It's curiously sporadic.

0 Kudos
ShawnCastrianni1
New Contributor II

I see this too on Android only.  I have to zoom in or out to get it to reload a new set of tiles.  But sometimes that doesn't even work.  PLEASE FIX!!!

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

What HttpClient implementation are you using?

HttpClient Stack and SSL/TLS Implementation Selector for Android - Xamarin | Microsoft Docs 

It may be worthwhile trying an alternative HttpClient implementation - see this comment for more info: https://community.esri.com/thread/224325-getting-401-unauthorized-accessing-secured-service-with-val... 

Cheers

Mike

0 Kudos
ShawnCastrianni1
New Contributor II

Good question.  I am currently set to Default which means Managed.  I will try switching and see what happens.  Thanks for the quick reply.

0 Kudos
ShawnCastrianni1
New Contributor II

The results look promising.  Because it was always sporadic/intermittent, I can't say for sure that it is fixed.  but I haven't been able to break it yet so that is great news!

0 Kudos