Document Navigation SDK for iOS Guides Utility Tools Route Calculation Error Codes

Route Calculation Error Codes

When a route calculation fails, the SDK calls the failure callback. The error information is provided in the error parameter. The table below lists the possible values of error.code. Additionally, error.userInfo and error.localizedFailureReason may contain supplementary information to help with troubleshooting.

Callback Method

/**
 * @brief Callback for driving route calculation failure. Available since 6.1.0.
 * @param driveManager The driving navigation manager instance.
 * @param error The error information. See AMapNaviCalcRouteState for error.code values.
 * @param type The route plan type. See AMapNaviRoutePlanType.
 */
- (void)driveManager:(AMapNaviDriveManager *)driveManager onCalculateRouteFailure:(NSError *)error routePlanType:(AMapNaviRoutePlanType)type;

Error Code Reference

Name

Required

Default

Meaning

Rule Description

code

Yes

-

Error code

See table below

Code

Description

Troubleshooting

0

Environment initialization error

The route calculation engine failed to initialize. Please submit a ticket to report this issue.

1

Route calculation successful

2

Network failure

Check your network connection and try again later.

3

Origin error

Ensure the origin is a valid coordinate within China and that the latitude/longitude format is correct.

4

Protocol parsing error

Please submit a ticket with the origin, destination, waypoints, and route calculation strategy.

5

Service exception

Try again later. If the issue persists, please submit a ticket with the origin, destination, waypoints, and route calculation strategy.

6

Destination error

Ensure the destination is a valid coordinate within China and that the latitude/longitude format is correct.

7

Server encoding error

Please submit a ticket with the origin, destination, waypoints, and route calculation strategy.

8

Insufficient preview data

Please submit a ticket with the origin, destination, waypoints, and route calculation strategy.

9

Data format error

Please submit a ticket with the origin, destination, waypoints, and route calculation strategy.

10

No road found near the origin

Adjust the origin location.

11

No road found near the destination

Adjust the destination location.

12

No road found near a waypoint

Adjust the waypoint location.

13

Route calculation failed

Please submit a ticket with the origin, destination, waypoints, route calculation strategy, and the NSError.description information.

19

Distance between origin, waypoints, or destination is too long

The straight-line distance between the origin, waypoints, and destination exceeds the limit. This typically occurs for truck or cycling/walking route calculations. Please submit a ticket with the origin, destination, waypoints, and the NSError information.

21

Waypoint error

Ensure all waypoints are valid coordinates within China and that the latitude/longitude format is correct.

2999

A new independent route calculation task is in progress, causing the current one to fail

When two consecutive route calculations are triggered, the first one is cancelled and returns error code 2999. Ensure that the previous route calculation result is returned before triggering the next one.

3000

No location permission

When performing a route calculation without an origin, the SDK detects authorizationStatus as kCLAuthorizationStatusDenied. Ensure your app has access to location services.

3001

No precise location permission

Both route calculation without an origin and real-time navigation require precise location. Ensure your app has the precise location permission.