我该如何解决无法解决:com.mapbox.navigator:mapbox-navigation-native:3.1.3?

时间:2018-10-03 23:52:52

标签: android-studio mapbox mapbox-android

我在使用mapbox-android-navigation时遇到问题:

  

无法解决:com.mapbox.navigator:mapbox-navigation-native:3.1.3 | MAPBOX **

enter image description here

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    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
    }
}

2 个答案:

答案 0 :(得分:3)

尝试添加

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

到您的项目根目录build.gradle文件

答案 1 :(得分:0)

如果出现错误:无法解决:com.mapbox.navigator:mapbox-navigation-native:5.0.0

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' }
    }
}