Jon Snow
Jon Snow

Reputation: 35

Mapbox UI classes cannot be imported

I am following this tutorial: https://docs.mapbox.com/help/tutorials/android-navigation-sdk/

No matter what I do these packages cannot be imported.

import com.mapbox.services.android.navigation.ui.v5.NavigationLauncherOptions;
import com.mapbox.services.android.navigation.ui.v5.route.NavigationMapRoute;
import com.mapbox.services.android.navigation.ui.v5.NavigationLauncher;

This is the error I get: package com.mapbox.services.android.navigation.ui.v5 does not exist

Any help will be highly appreciated.

Upvotes: 0

Views: 563

Answers (1)

Jon Snow
Jon Snow

Reputation: 35

Apparently, the tutorial is missing about one attribute that has to be imported in the gradle. So,

Aside from adding:

implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.42.6'

You must add this too:

implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.6'

Upvotes: 1

Related Questions