Error when solving route using StreetMap Premium Custom Roads

586
3
11-04-2020 07:46 PM
JamesLai1
New Contributor

Hi,

I am using ArcGIS Runtime for Android v100.7, and encountered the following error when calling the solveRouteAsync(routeParameters) method:

com.esri.arcgisruntime.ArcGISRuntimeException: The requested field was not found

I am using StreetMap Premium Custom Roads, and have drawn some custom roads and left the custom road fields to default values (including road name), after which is then generated into Mobile Map Package (mmpk) to be used with ArcGIS Runtime for Android

I'm guessing that some field values will need to be filled in, appreciate if someone can enlighten on this

Thanks much!

-James-

Tags (1)
0 Kudos
3 Replies
MarkBaird
Esri Regular Contributor

James,

Just wanted to let you know that I'm seeking out someone from the StreetMap Premium team to help answer this question.  

In the meantime, it would be handy to know if the routing works in your data when consumed in ArcGIS Pro?  If it's not working in Pro, then its unlikely to work in a Runtime app.

More information will follow.

Thanks

Mark

0 Kudos
JamesLai1
New Contributor

Hi Mark,

Thanks for helping

Yes the routing works when used in ArcGIS Pro

Some other info:

1) The error will only occur when trying to solve a route that has Stops plotted on the custom roads

2) Code:

private void startNavigation() {
      ListenableFuture<RouteParameters> routeParametersFuture = localRouteTask.createDefaultParametersAsync();
      routeParametersFuture.addDoneListener(() -> {
         try {
               // define the route parameters
               RouteParameters routeParameters = routeParametersFuture.get();
               routeParameters.setStops(getStops_All());
               routeParameters.setReturnDirections(true);
               routeParameters.setReturnStops(true);
               routeParameters.setReturnRoutes(true);
               routeParameters.setOutputSpatialReference(SpatialReferences.getWgs84());
               ListenableFuture<RouteResult> routeResultFuture = localRouteTask.solveRouteAsync(routeParameters);

               routeParametersFuture.addDoneListener(() -> {
                  try {
                     RouteResult routeResult = routeResultFuture.get();

Error stack trace:

java.util.concurrent.ExecutionException: com.esri.arcgisruntime.ArcGISRuntimeException: The requested field was not found.
at com.esri.arcgisruntime.internal.b.b.get(SourceFile:137)
at com.example.st.arcgiscss.activites.MainActivity.lambda$null$5$MainActivity(MainActivity.java:1867)
at com.example.st.arcgiscss.activites.-$$Lambda$MainActivity$DuZ8-HqDdbEkdrZ-0cnN1975aXk.run(Unknown Source:6)
at com.esri.arcgisruntime.internal.b.g.b(SourceFile:45)
at com.esri.arcgisruntime.internal.b.e.a(SourceFile:67)
at com.esri.arcgisruntime.internal.b.b.addDoneListener(SourceFile:158)
at com.example.st.arcgiscss.activites.MainActivity.lambda$startNavigation$6$MainActivity(MainActivity.java:1861)
at com.example.st.arcgiscss.activites.-$$Lambda$MainActivity$a59S2M1su8rLA5cdVVs9gRVUhbU.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8016)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
Caused by: com.esri.arcgisruntime.ArcGISRuntimeException: The requested field was not found.
at com.esri.arcgisruntime.internal.jni.CoreTask.nativeGet(Native Method)
at com.esri.arcgisruntime.internal.jni.CoreTask.d(SourceFile:116)
at com.esri.arcgisruntime.internal.b.b.get(SourceFile:135)
at com.example.st.arcgiscss.activites.MainActivity.lambda$null$5$MainActivity(MainActivity.java:1867)
at com.example.st.arcgiscss.activites.-$$Lambda$MainActivity$DuZ8-HqDdbEkdrZ-0cnN1975aXk.run(Unknown Source:6)
at com.esri.arcgisruntime.internal.b.g.b(SourceFile:45)
at com.esri.arcgisruntime.internal.b.e.a(SourceFile:67)
at com.esri.arcgisruntime.internal.b.b.addDoneListener(SourceFile:158)
at com.example.st.arcgiscss.activites.MainActivity.lambda$startNavigation$6$MainActivity(MainActivity.java:1861)
at com.example.st.arcgiscss.activites.-$$Lambda$MainActivity$a59S2M1su8rLA5cdVVs9gRVUhbU.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8016)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

-----------------------------------------------------

0 Kudos
FrankKish
Esri Contributor
  • are you using the travel modes that "came with" custom roads or did you add a new one or alter an existing one?
  • what version of custom roads are you using and which region?
  • maybe try setting these to false one at a time to see that narrows down the cause

         routeParameters.setReturnDirections(true);
     routeParameters.setReturnStops(true);
     routeParameters.setReturnRoutes(true);

0 Kudos