Hexagon Geospatial

M.App Enterprise

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Posts: 23
Registered: ‎04-19-2018

GPS disabled crashes the App Mobile

Hi guys,


We've detected that when we open a Form that uses the setGpsPosition function, if the GPS is disabled, the app crashes and closes after a few seconds.


I add the log below:


‎A task was canceled.‎    
  at Plugin.Geolocator.GeolocatorImplementation.GetPositionAsync (System.Nullable`1[T] timeout, System.Nullable`1[T] cancelToken, System.Boolean includeHeading) [0x004d3] in <e6cb69436f5b455fa0a66dc46ca4b792>:0 
  at AppShell.GpsProvider.RefreshPosition () [0x000a9] in <3bc9f56126c54955a90325d43429cc07>:0 
  at AppShell.FormScriptContext.SetGpsPosition (System.String field, System.String accuracyField) [0x0007a] in <3bc9f56126c54955a90325d43429cc07>:0 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <b229320276a94f5ea17269418890d115>:0 
  at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <496a5bfd4ca4433780872bb03167ca2e>:0 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <496a5bfd4ca4433780872bb03167ca2e>:0 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <496a5bfd4ca4433780872bb03167ca2e>:0 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.35(intptr,intptr)


Is it possible to catch this to prevent the app closing and throw a warning message advising GPS is disabled?



Thank you!




Posts: 98
Registered: ‎10-25-2016

Re: GPS disabled crashes the App Mobile



I can't reproduce the crash on my Android device, but we will improve the check for GPS in setGpsPosition nevertheless.




Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Development Ticket through our Development Ticket Portal.