Fail to execute Offline Routing Task

3151
5
Jump to solution
04-28-2014 03:55 PM
AlexanderLitvak
New Contributor II
Hello, I'm getting error message 'NSRangeException Reason: *** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' when I'm running Task for Offline Routing.
It is fail on initializing AGSRouteTask in this section below, in the last row:
SError* error = nil;
NSString* docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString* fullPath = [docDir stringByAppendingPathComponent:@"NetworkData.bundle/RuntimeSanFrancisco.geodatabase"];
_routeTask = [AGSRouteTask routeTaskWithDatabasePath:fullPath network:@"Streets_ND" error:&error];

*All required files are copied in to Document folder and before I'm initializing task I validate existence of *.geodatabase and Streets_ND.
*Installed SDK Runtime version 10.2.3.
*Same class has Online Routing and it is working just fine, only when I'm switching to use Offline Routing with the code above it is fail.

Thanks,
Alex
0 Kudos
1 Solution

Accepted Solutions
AlexanderLitvak
New Contributor II
The issue resolved, the ArcGIS.bundle in the Xamarin project didn't updated properly.
By removing it and adding it back the issue resolved.
Thank you all for support!

View solution in original post

0 Kudos
5 Replies
NimeshJarecha
Esri Regular Contributor
Could you please add routing dataset to the project as described in the doc and see if it works?

Note:
When adding these files to your project, make sure you choose the Create folder references for any added folders option. This will ensure that the folder hierarchy of the *.tn folder is properly maintained.

Regards,
Nimesh
0 Kudos
AlexanderLitvak
New Contributor II
Hi Nimesh,

I've followed the second approach "Using network dataset copied through iTunes file sharing" and still getting same error.
Info.plist contains <key>UIFileSharingEnabled</key><true/>

Thanks,
Alex
0 Kudos
AlexanderLitvak
New Contributor II
Hi Nimesh,

One more comment. If I'm implementing this with the first approach "Using network dataset included within the application", then there is no error thrown, and it is never return success or failure result.

Thanks,
Alex
0 Kudos
DiveshGoyal
Esri Regular Contributor
Can you share your project and data with us?
Also, what is the value of the error variable after the route task fails initialization
0 Kudos
AlexanderLitvak
New Contributor II
The issue resolved, the ArcGIS.bundle in the Xamarin project didn't updated properly.
By removing it and adding it back the issue resolved.
Thank you all for support!
0 Kudos