为什么 mapbox-android sdk 不能从 build.gradle 解析? [英] Why is mapbox-android sdk not resolving from build.gradle?
问题描述
我正在尝试在此处设置基本教程,但被 Android Studio 中的错误阻止:https://docs.mapbox.com/android/maps/overview/#install-the-maps-sdk
I'm trying to setup the basic tutorial here but i am blocked by errors in Android Studio: https://docs.mapbox.com/android/maps/overview/#install-the-maps-sdk
错误 1:当我同步 build.gradle 时看到:
Error 1: seen when i Sync the build.gradle:
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.mapbox.mapboxsdk:mapbox-android-sdk:9.4.0.
然后我添加了推荐的排除项,但仍然出现错误.
I then added the recommended exclude items and still get the error.
错误 2:它说要从命令行运行 gradle,但也没有找到.
Error 2: It says to run gradle from the command line but that is not found either.
这是我的 build.gradle 的相关部分:
Here's the relevant part of my build.gradle:
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.4.0'
implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:9.4.0'){
exclude group: 'group_name', module: 'module_name'
}
}
推荐答案
我也遇到了这个问题,用旧版本的mapbox解决了,新版本连接mapbox服务器有问题
i also faced this issue , isolved it by using an old version of mapbox the new version has some issue connecting to the mapbox server
尝试使用此版本或其他版本
try using this or some other version
dependencies{
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.0.0'
}
allprojects {
repositories {
...
mavenCentral()
}
}
这篇关于为什么 mapbox-android sdk 不能从 build.gradle 解析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!