0

I'm new to Kotlin and Java programming and have just finished the basics. I'm currently trying to build a Mapbox navigation Android app but am running into several issues related to various Mapbox modules, including replay, examples, ui, Routeline, tripprogress, and voice.

Specifically, I am unable to import some classes from these modules. Below are the details of my setup:

import com.mapbox.navigation.core.replay.ReplayLocationEngine
import com.mapbox.navigation.examples.R
import com.mapbox.navigation.examples.databinding.MapboxActivityTurnByTurnExperienceBinding
import com.mapbox.navigation.ui.maneuver.api.MapboxManeuverApi
import com.mapbox.navigation.ui.maps.route.line.model.MapboxRouteLineOptions
import com.mapbox.navigation.ui.tripprogress.api.MapboxTripProgressApi
import com.mapbox.navigation.ui.voice.api.MapboxSpeechApi

I have added the necessary dependencies as well:

dependencies {
    implementation 'com.mapbox.navigation:android-navigation:2.11.1'
    implementation 'com.mapbox.navigationcore:navigation:3.0.2'
    implementation 'com.mapbox.navigationcore:ui-components:3.2.0'
    // other dependencies...
}

I have tried invalidating caches, cleaning, rebuilding, and restarting, but the issue persists.

Any workable solution or guidance would be greatly appreciated. Thank you in advance for your assistance!

1 Answer 1

0

Most likely the cause is lacking the MapBox repository or credentials.

Sign up to request clarification or add additional context in comments.

2 Comments

Thankyou for the reply. I have added the Repository in settings.gradle.kts as per the documentation Android Studio Arctic Fox (2020.3.1) or later and Gradle v6.0 or later: You may need to make these declarations in your settings.gradle file instead. Do i need to take new public and private access token for this navigation project. Because i am using the same access token which i used to build maps using maps sdk in other project file.
Gradle/Groovy and Kotlin Script are quite the same, one just should stick with one of them. Not sure about MapBox, but when the credentials are per package-name and not per developer, you'd need new ones. But with the same credentials, one cannot tell apart the amount of API requests per package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.