无法解析mapbox-android-sdk
我正在尝试添加最新版本的地图框,但失败了。 我已经关注了
gradle.properties< 中的 MapBox 文档 秘密令牌/strong> 文件:
MAPBOX_DOWNLOADS_TOKEN=MY_SECRET_MAPBOX_ACCESS_TOKEN_IN_PAIN_TEXT_WITHOUT_QUOTES
下载令牌是从具有 DOWNLOAD:READ 权限的 MapBox 站点生成的,正如他们在文档中提到的那样,它以 sk 开头。
MAPBOX_DOWNLOADS_TOKEN=sk.sdjshdjshdj.....etc
我的 settings.gradle 文件。
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = "mapbox"
// Use the secret token you stored in gradle.properties as the password
password = MAPBOX_DOWNLOADS_TOKEN
}
}
maven { url "https://maven.google.com" }
maven { url 'https://jitpack.io' }
}
}
同步 Gradle 文件后的应用程序级别 gradle 文件
dependencies {
//OTHER DEPENDENCIES....
implementation 'com.mapbox.maps:android:10.3.0'
}
。
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.mapbox.mapboxsdk:mapbox-android-sdk:10.3.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.mapbox.mapboxsdk:mapbox-android-sdk:10.3.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.mapbox.mapboxsdk:mapbox-android-sdk:10.3.0.
Show Details
Affected Modules: app
我已经检查了下面的答案,但不起作用。
我不知道出了什么问题。 提前致谢。
I am trying to add latest version of Map box, but its failing.
I have followed MapBox Documentation
secret token in gradle.properties file:
MAPBOX_DOWNLOADS_TOKEN=MY_SECRET_MAPBOX_ACCESS_TOKEN_IN_PAIN_TEXT_WITHOUT_QUOTES
Download Token is generated from MapBox site with DOWNLOAD:READ permission, as they mentioned in the documentation and it was starting with sk.
MAPBOX_DOWNLOADS_TOKEN=sk.sdjshdjshdj.....etc
My settings.gradle File.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = "mapbox"
// Use the secret token you stored in gradle.properties as the password
password = MAPBOX_DOWNLOADS_TOKEN
}
}
maven { url "https://maven.google.com" }
maven { url 'https://jitpack.io' }
}
}
app level gradle file
dependencies {
//OTHER DEPENDENCIES....
implementation 'com.mapbox.maps:android:10.3.0'
}
After Syncing Gradle Files.
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.mapbox.mapboxsdk:mapbox-android-sdk:10.3.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.mapbox.mapboxsdk:mapbox-android-sdk:10.3.0.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.mapbox.mapboxsdk:mapbox-android-sdk:10.3.0.
Show Details
Affected Modules: app
I have checked below answers, but not working.
- How to solve : Failed to resolve: com.mapbox.mapboxsdk:mapbox-android-sdk:9.5.0
- Why is mapbox-android sdk not resolving from build.gradle?
I don't know what's wrong.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我为此苦苦挣扎了两天。版本 9.2.6 使用相同的文档。另请确保将 settings.gradle 更改为 PREFER_SETTINGS。将 maven {url 'https://mapbox.bintray.com/mapbox' } 添加到 mavencentral 下的项目级别 gradle 中。您的 MAPBOX_DOWNLOADS_TOKEN 将以“sk”而不是“pk”开头。下载私钥时,请检查下载:阅读
I was struggling with this for two days. Version 9.2.6 works with the same documentation. Also make sure you change your settings.gradle to PREFER_SETTINGS. Add maven {url 'https://mapbox.bintray.com/mapbox' } to your project level gradle under maven central. your MAPBOX_DOWNLOADS_TOKEN will start with "sk" instead of "pk". When downloading your private key, check the DOWNLOADS:READ
这是我的 build.gradle 项目级别的样子:
build.gradle 应用程序级别:
我正在为视图提供令牌:
Here is how my build.gradle project level looks like:
build.gradle app level:
And I am providing the view with the token: