The code for creating routes, route options, and starting the navigation has not changed in my project, yet in Navigation 0.20.0 and 0.21.0, the app now crashes as soon as the route is calculated and the navigation starts in the NavigationView.
Console Logs:
FATAL EXCEPTION: main java.lang.NoSuchFieldError: no "Lcom/mapbox/geojson/Point;" field "location" in class "Lcom/mapbox/navigator/FixLocation;" or its superclasses
at com.mapbox.navigator.Navigator.updateLocation(Native Method)
at com.mapbox.services.android.navigation.v5.navigation.MapboxNavigator.a(MapboxNavigator.java:36)
at com.mapbox.services.android.navigation.v5.navigation.RouteProcessorBackgroundThread.a(RouteProcessorBackgroundThread.java:60)
at com.mapbox.services.android.navigation.v5.navigation.NavigationLocationEngineListener.onLocationChanged(NavigationLocationEngineListener.java:31)
at com.mapbox.services.android.navigation.v5.navigation.NavigationLocationEngineUpdater.a(NavigationLocationEngineUpdater.java:34)
at com.mapbox.services.android.navigation.v5.navigation.NavigationService.a(NavigationService.java:68)
at com.mapbox.services.android.navigation.v5.navigation.MapboxNavigation.onServiceConnected(MapboxNavigation.java:726)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1386)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1403)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
Android API:
22 - 27
Mapbox Navigation SDK version:
This issue did not happen with the following SDK versions:
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.16.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.18.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.19.0'
It does happen in the following SDK versions:
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.20.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.21.0'
Steps to trigger behavior
- Calculate the route between origin and destination.
- Create the navigationViewOptions.
- startNavigation in the navigationView
- Crash
Expected behavior
No crashes. LOL.
Actual behavior
As soon as the the navigation starts, there is a crash (See previous debug output). The app has been working fine up until SDK 20. Any ideas why this may be happening? Is there something I needed to add for SDK 20 that it might be missing?
Code:
NavigationRoute.builder(mContext)
.accessToken(Mapbox.getAccessToken())
.origin(origin)
.destination(destination)
.profile(navTypeFormat)
.exclude(EXCLUDE_TOLL)
.language(Locale.ENGLISH)
.build()
.getRoute(new Callback<DirectionsResponse>() {
@Override
public void onResponse(Call<DirectionsResponse> call, Response<DirectionsResponse> response) {
currentRoute = response.body().routes().get(0);
NavigationViewOptions.Builder navigationViewOptions = NavigationViewOptions.builder();
navigationViewOptions.directionsRoute(currentRoute);
navigationViewOptions.navigationListener(NavigationActivity.this);
navigationViewOptions.milestoneEventListener(NavigationActivity.this);
navigationViewOptions.speechAnnouncementListener(NavigationActivity.this);
navigationViewOptions.bannerInstructionsListener(NavigationActivity.this);
navigationViewOptions.routeListener(NavigationActivity.this);
navigationViewOptions.shouldSimulateRoute(false);
navigationView.startNavigation(navigationViewOptions.build());
}
@Override
public void onFailure(Call<DirectionsResponse> call, Throwable throwable) {
showNoRoutesAlert();
}
});
The code for creating routes, route options, and starting the navigation has not changed in my project, yet in Navigation 0.20.0 and 0.21.0, the app now crashes as soon as the route is calculated and the navigation starts in the NavigationView.
Console Logs:
Android API:
22 - 27
Mapbox Navigation SDK version:
This issue did not happen with the following SDK versions:
It does happen in the following SDK versions:
Steps to trigger behavior
Expected behavior
No crashes. LOL.
Actual behavior
As soon as the the navigation starts, there is a crash (See previous debug output). The app has been working fine up until SDK 20. Any ideas why this may be happening? Is there something I needed to add for SDK 20 that it might be missing?
Code: