Error Map "System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and "

Dear, when trying to deploy an MMPK file, the APK Interviewer throws the following error and terminates the application.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List1[T].get_Item (System.Int32 index) [0x00009] in <c72658f647bc485bbfb8c9fcaa790862>:0 at Esri.ArcGISRuntime.RuntimeCollection1[T].GetItem (System.Int32 index) [0x00000] in <690269dd3d914be9b36ba5ea4ee75e34>:0
at Esri.ArcGISRuntime.RuntimeCollection`1[T].get_Item (System.Int32 index) [0x00000] in <690269dd3d914be9b36ba5ea4ee75e34>:0
at WB.UI.Shared.Extensions.CustomServices.MapDashboard.MapDashboardViewModel.UpdateBaseMap () [0x000b2] in :0
at WB.UI.Shared.Extensions.CustomServices.MapDashboard.MapDashboardViewModel.b__33_2 (System.Object sender, System.EventArgs e) [0x0007b] in :0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in :0
at Android.App.SyncContext+<>c__DisplayClass2_0.b__0 () [0x00000] in <59fa04ac5fe141b381198527f231422f>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <59fa04ac5fe141b381198527f231422f>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <59fa04ac5fe141b381198527f231422f>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.30(intptr,intptr)

Is this a valid file?
Can it be opened in ArcGIS? If no - then Survey Solutions will also not display it.
If yes, does it show any warning messages during opening? What are they?
If it opens - what is the content of the file?

Is this a valid file? if it is valid

Can it be opened in ArcGIS? Yes, it can be opened from ArcGIS PRO

If yes, does it show any warning messages during opening? No warning messages What are they?
If it opens, what is the content of the file? Basemap and Polygons

Hello Felipe, please backup the original MMPK file, then open a copy in your ArcGIS and delete the polygons leaving solely the basemap layer. Resave under a different name and pass to the interviewer. See if that makes it work then. (hope it does). Best, Sergiy

I did everything indicated and the errors remain:
01:51:32[0, Culture=neutral, PublicKeyToken=null]]][Error][Android.Runtime.JavaProxyThrowable: Exception of type ‘Android.Runtime.JavaProxyThrowable’ was thrown.
— End of managed Android.Runtime.JavaProxyThrowable stack trace —
android.runtime.JavaProxyThrowable: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List1[T].get_Item (System.Int32 index) [0x00009] in <c72658f647bc485bbfb8c9fcaa790862>:0 at Esri.ArcGISRuntime.RuntimeCollection1[T].GetItem (System.Int32 index) [0x00000] in <690269dd3d914be9b36ba5ea4ee75e34>:0
at Esri.ArcGISRuntime.RuntimeCollection1[T].get_Item (System.Int32 index) [0x00000] in <690269dd3d914be9b36ba5ea4ee75e34>:0 at WB.UI.Shared.Extensions.CustomServices.MapDashboard.MapDashboardViewModel.UpdateBaseMap () [0x000b2] in <f0bcfe02ff874c35b9500a14ebf15395>:0 at WB.UI.Shared.Extensions.CustomServices.MapDashboard.MapDashboardViewModel.<get_SwitchMapCommand>b__65_0 (WB.Core.SharedKernels.Enumerator.Services.MapService.MapDescription mapDescription) [0x0007a] in <f0bcfe02ff874c35b9500a14ebf15395>:0 at MvvmCross.Commands.MvxAsyncCommandBase.ExecuteConcurrentAsync (System.Object parameter, System.Boolean hideCanceledException) [0x0010e] in <687f2e5f7efd4e33b498a18ba9db221f>:0 at MvvmCross.Commands.MvxAsyncCommandBase.ExecuteAsync (System.Object parameter, System.Boolean hideCanceledException) [0x00085] in <687f2e5f7efd4e33b498a18ba9db221f>:0 at MvvmCross.Commands.MvxAsyncCommandBase.Execute (System.Object parameter) [0x0009a] in <687f2e5f7efd4e33b498a18ba9db221f>:0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in <c72658f647bc485bbfb8c9fcaa790862>:0 at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <59fa04ac5fe141b381198527f231422f>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <59fa04ac5fe141b381198527f231422f>:0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <59fa04ac5fe141b381198527f231422f>:0 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.30(intptr,intptr) at mono.java.lang.RunnableImplementor.n_run(Native Method) at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7325) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1321) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1211) ]Android.Runtime.JavaProxyThrowable: Exception of type 'Android.Runtime.JavaProxyThrowable' was thrown. --- End of managed Android.Runtime.JavaProxyThrowable stack trace --- android.runtime.JavaProxyThrowable: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.Generic.List1[T].get_Item (System.Int32 index) [0x00009] in :0
at Esri.ArcGISRuntime.RuntimeCollection1[T].GetItem (System.Int32 index) [0x00000] in <690269dd3d914be9b36ba5ea4ee75e34>:0 at Esri.ArcGISRuntime.RuntimeCollection1[T].get_Item (System.Int32 index) [0x00000] in <690269dd3d914be9b36ba5ea4ee75e34>:0
at WB.UI.Shared.Extensions.CustomServices.MapDashboard.MapDashboardViewModel.UpdateBaseMap () [0x000b2] in :0
at WB.UI.Shared.Extensions.CustomServices.MapDashboard.MapDashboardViewModel.<get_SwitchMapCommand>b__65_0 (WB.Core.SharedKernels.Enumerator.Services.MapService.MapDescription mapDescription) [0x0007a] in :0
at MvvmCross.Commands.MvxAsyncCommandBase.ExecuteConcurrentAsync (System.Object parameter, System.Boolean hideCanceledException) [0x0010e] in <687f2e5f7efd4e33b498a18ba9db221f>:0
at MvvmCross.Commands.MvxAsyncCommandBase.ExecuteAsync (System.Object parameter, System.Boolean hideCanceledException) [0x00085] in <687f2e5f7efd4e33b498a18ba9db221f>:0
at MvvmCross.Commands.MvxAsyncCommandBase.Execute (System.Object parameter) [0x0009a] in <687f2e5f7efd4e33b498a18ba9db221f>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in :0
at Android.App.SyncContext+<>c__DisplayClass2_0.b__0 () [0x00000] in <59fa04ac5fe141b381198527f231422f>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <59fa04ac5fe141b381198527f231422f>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <59fa04ac5fe141b381198527f231422f>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.30(intptr,intptr)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1321)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1211)
|AndroidEnvironment.UnhandledException => EnumeratorSetup1.<.ctor>b__0_1 => EnumeratorSetup1.ProcessException
01:51:32[0, Culture=neutral, PublicKeyToken=null]]][Error][System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List1[T].get_Item (System.Int32 index) [0x00009] in <c72658f647bc485bbfb8c9fcaa790862>:0 at Esri.ArcGISRuntime.RuntimeCollection1[T].GetItem (System.Int32 index) [0x00000] in <690269dd3d914be9b36ba5ea4ee75e34>:0
at Esri.ArcGISRuntime.RuntimeCollection`1[T].get_Item (System.Int32 index) [0x00000] in <690269dd3d914be9b36ba5ea4ee75e34>:0
at WB.UI.Shared.Extensions.CustomServices.MapDashboard.MapDashboardViewModel.UpdateBaseMap () [0x000b2] in :0
at WB.UI.Shared.Extensions.CustomServices.MapDashboard.MapDashboardViewModel.<get_SwitchMapCommand>b__65_0 (WB.Core.SharedKernels.Enumerator.Services.MapService.MapDescription mapDescription) [0x0007a] in :0
at MvvmCross.Commands.MvxAsyncCommandBase.ExecuteConcurrentAsync (System.Object parameter, System.Boolean hideCanceledException) [0x0010e] in <687f2e5f7efd4e33b498a18ba9db221f>:0
at MvvmCross.Commands.MvxAsyncCommandBase.ExecuteAsync (System.Object parameter, System.Boolean hideCanceledException) [0x00085] in <687f2e5f7efd4e33b4

Dear Felipe,

I regret to hear that the problem still persists. Could you please send to support an example of the map file which fails to be displayed to the support email? You can reduce it in size and/or quality, as long as:

  • the problem is still reproducible in Survey Solutions, AND
  • the file is accepted/opened without a problem in ArcGIS

If the file is large, please share a password protected link from a file share or cloud storage.

It would (probably) be useful if you could provide a recipe of how the file was prepared, something along the lines of:

The original file was downloaded from {URL} opened in ArcGIS version {#.#}, vector layers removed, raster layers flattened, file reprojected from {P1} to {P2} and re-saved.

Anything you know may become important.

Thank you, Sergiy

@Felipe_Jimenez has sent an example file to the support email. The file contains no basemap layer. Survey Solutions does expect a base map layer in the *.MMPK file and fails with an error if it doesn’t find it (as documented by the logs shown earlier).

Since the file itself is formally compliant with an MMPK format, no message is issued to the user at any step. We will change this behavior and the user will be notified that the file is not suitable for Survey Solutions.