2

I am currently building an android navigation app and have run into an issue. The full error is:

Execution failed for task ':app:checkDebugAarMetadata'. Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.mapbox.navigator:mapbox-navigation-native:7.0.0. > Searched in the following locations: >- https://dl.google.com/dl/android/maven2/com/mapbox/navigator/mapbox-navigation-native/7.0.0/mapbox-navigation-native-7.0.0.pom > - https://jcenter.bintray.com/com/mapbox/navigator/mapbox-navigation-native/7.0.0/mapbox-navigation-native-7.0.0.pom >- https://api.mapbox.com/downloads/v2/releases/maven/com/mapbox/navigator/mapbox-navigation-native/7.0.0/mapbox-navigation-native-7.0.0.pom >Required by: >project :app > com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.6 > com.mapbox.mapboxsdk:mapbox-android-navigation:0.42.6

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

In my app-level build.gradle file, I added this dependency: implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.6'

And in my module-level build.gradle file, under repositories, I added this: maven { url 'https://mapbox.bintray.com/mapbox' }

So I am really not sure why it is giving me this issue. Could anyone possibly assist?

Mark van Heerden
  • 215
  • 4
  • 15

2 Answers2

1

I had the same problem and solved it by deleting all maven entries that had something to do with bitray like:

maven { url  "http://dl.bintray.com/piasy/maven" }
maven { url 'https://mapbox.bintray.com/mapbox' }

the next step is to set the mapbox download url to:

'https://api.mapbox.com/downloads/v2/releases/maven'

Then i changed the username to 'mapbox' like this:

   maven {
       // url 'https://api.mapbox.com/downloads/v1/navigation/android/maven' // old one
        url 'https://api.mapbox.com/downloads/v2/releases/maven' // new one
        authentication {
            basic(BasicAuthentication)
        }
        credentials {
            username = "mapbox" // This should always be `mapbox` (not your username).
            password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
        }
    }

If doing this you get error 401 instead of 403 you will have to create a new, secret Mapbox Access Token with the scope DOWNLAODS:READ

I hope it is helpfull for you!

refs: https://github.com/mapbox/mapbox-navigation-android/issues/4533#issuecomment-880672321

0

Where exactly did you add the repository? This is supposed to be in the module level build.gradle under allprojects>repositories:

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://mapbox.bintray.com/mapbox' }
        
    }
}

If you are starting your development with Mapbox, I would recommend to start with the recent version of the Navigation SDK, as the move to 1.0+ will make breaking changes to the application you are building with the tutorial.

I would recommend following this example: https://docs.mapbox.com/android/navigation/examples/basic-nav-sdk-only/

Please be aware that the way to add the dependencies has changed with Navigation SDK 1.0+. This is documented here: https://docs.mapbox.com/android/navigation/overview/#install-the-navigation-sdk

MashukKhan
  • 1,946
  • 1
  • 27
  • 46
Moritz
  • 1,710
  • 1
  • 8
  • 13
  • That is exactly where I added the repository, sorry that I didn't specify enough in my original post. I have read through the example you linked and chose not to follow it as it is only in Kotlin and not Java and I am not familiar with Kotlin. – Mark van Heerden Nov 06 '20 at 14:36