mapbox / mapbox/mapbox-navigation-android
Any tile edge can only be used once as part of the geometry
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Android OS version: Android 7+
- Devices affected: Samsung, Oppo, Xiomi etc
- Maps SDK Version: sdk:9.6.1
## Observed behavior and steps to reproduce
I'm using UI as module in my android project,
But observing this exception, occurring multiple time, but couldn't know about the root caused.
Fatal Exception: java.lang.Error: Any tile edge can only be used once as part of the geometry
at com.mapbox.navigator.Navigator.getRouteBufferGeoJson(SourceFile) at com.mapbox.services.android.navigation.v5.navigation.MapboxNavigator.retrieveRouteGeometryWithBuffer(MapboxNavigator.java:2)
at com.mapbox.services.android.navigation.v5.navigation.NavigationRouteProcessor.updateRoute(NavigationRouteProcessor.java:22) at com.mapbox.services.android.navigation.v5.navigation.NavigationRouteProcessor.buildNewRouteProgress(NavigationRouteProcessor.java:22)
at com.mapbox.services.android.navigation.v5.navigation.RouteProcessorRunnable.process(RouteProcessorRunnable.java:55)
at com.mapbox.services.android.navigation.v5.navigation.RouteProcessorRunnable.run(RouteProcessorRunnable.java:55)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:268)
at android.os.HandlerThread.run(HandlerThread.java:67)
## What I have DONE to get rid of it:
**InSDKClass: MapboxNavigator:
I have updated this method to:**
```
@Nullable
synchronized Geometry retrieveRouteGeometryWithBuffer() {
String routeGeometryWithBuffer = navigator.getRouteBufferGeoJson(GRID_SIZE, BUFFER_DILATION);
if (routeGeometryWithBuffer == null) {
return null;
}
return GeometryGeoJson.fromJson(routeGeometryWithBuffer);
}
```
**as this**
```
@Nullable
synchronized Geometry retrieveRouteGeometryWithBuffer() {
try {
String routeGeometryWithBuffer = navigator.getRouteBufferGeoJson(GRID_SIZE, BUFFER_DILATION);
if (routeGeometryWithBuffer == null) {
return null;
}
return GeometryGeoJson.fromJson(routeGeometryWithBuffer);
}catch(Exception e){
return null;
}
}
```
**and also:
From class: NavigationRouteProcessor
I have updated some other method too
BASE Calling METHOD:**
```
private void updateRoute(DirectionsRoute route, MapboxNavigator navigator) {
if (this.route == null || !this.route.equals(route)) {
this.route = route;
routeGeometryWithBuffer = navigator.retrieveRouteGeometryWithBuffer();
}
}
```
**And Changed Method original:**
```
private void addRouteGeometries(RouteProgress.Builder progressBuilder) {
progressBuilder.routeGeometryWithBuffer(routeGeometryWithBuffer);
}
```
**UPDATED:**
```
private void addRouteGeometries(RouteProgress.Builder progressBuilder) {
if (routeGeometryWithBuffer != null) {
progressBuilder.routeGeometryWithBuffer(routeGeometryWithBuffer);
}
}
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the stack trace in MapboxNavigator.retrieveRouteGeometryWithBuffer and trace how NavigationRouteProcessor.updateRoute and addRouteGeometries consume the result. Reproduce the Android 7+ route-processing failure and determine why getRouteBufferGeoJson raises the tile-edge error. Done means the exception no longer crashes route processing while route geometry remains handled correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100