Mapbox-navigation-android: Failed to resolve: com.mapbox.navigator:mapbox-navigation-native:3.1.3

Created on 2 Oct 2018  路  15Comments  路  Source: mapbox/mapbox-navigation-android

Hello,

My gradle build is failing to sync with the following dependencies:

implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.5.0@aar'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.20.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.9.0'

The error is: Failed to resolve: com.mapbox.navigator:mapbox-navigation-native:3.1.3. I have mavenCentral() in my repositories, however I can't find the mapbox-navigation-native package in maven central. Do I need to add another repository? Or has the artifact not been published to maven central yet?

Let me know if you need any more information, thanks!

Most helpful comment

@Hashir524 full example, please make sure it's in the right spot:

buildscript {
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
    }
}

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

All 15 comments

I have the same issue, just following the tutorial in https://www.mapbox.com/help/android-navigation-sdk/

implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:6.5.0@aar') {
       transitive = true
}
implementation('com.mapbox.mapboxsdk:mapbox-sdk-services:4.0.0')
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.20.0'
implementation ('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.20.0') {
       transitive = true
}

As noted in v0.20.0 release notes

Important Note: With this release, you _must_ include the following snippet in your project鈥檚 build.gradle:

repositories {
   maven { url 'https://mapbox.bintray.com/mapbox' }
}

This will ensure the mapbox dependency is properly downloaded. We will be adding a snippet regarding this in the repo README and in the Android docs site as well.

Thanks for checking out the SDK @Kahtaf and @typebrook 馃檹

Closing as answered.

Still Not Working.
repositories {
google()
jcenter()
maven { url 'https://mapbox.bintray.com/mapbox' }
}
dependencies
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.5.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.8.2'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.20.0'
implementation ('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.20.0'){
transitive = true
}

@Hashir524 full example, please make sure it's in the right spot:

buildscript {
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
    }
}

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

Thank you @danesfeder for the full example it works for me, indeed following the official tutorial I put maven {url 'https://mapbox.bintray.com/mapbox'} in the buildscript section and moving it in the allprojects section all works well.

Glad to hear @didiramzi Thanks for the update!

@Guardiola31337 Hi its not working for me even If I put in the repository as you described

Ran into the same problem, fixed by .https://github.com/mapbox/mapbox-navigation-android/issues/1381#issuecomment-428654714

Ideally the tutorial at https://docs.mapbox.com/help/tutorials/android-navigation-sdk/#install-the-navigation-sdk could be updated to be a bit clearer on where the lines need to go.

Hey @andrewharvey 馃憢 thanks for the feedback. Just to clarify, do you mean with regard to buildscript vs. allprojects with the bintray URL placement?

Yeah, with regards to placing the line in allprojects instead of buildscript at https://docs.mapbox.com/help/tutorials/android-navigation-sdk/#install-the-navigation-sdk.

When you create a new project in Android Studio you get two build.gradle files (one for the Project, and one for the Module) so for someone completely new to Android development it's unclear which one to place these lines into, and then if it goes into the repositories section in buildscript or allprojects.

@andrewharvey totally, thanks for clarifying! I just opened a documentation PR to address this https://github.com/mapbox/android-docs/pull/906.

Thanks, I didn't realise the docs were open source!

i have same problem and by adding mapbox maven into allproject in build.gradle project level problem solved.

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

Yes, it does fix the issue.

@Hashir524 full example, please make sure it's in the right spot:

buildscript {
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
    }
}

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

THANK YOU OMG!!!!

Was this page helpful?
0 / 5 - 0 ratings