我正在用Java开发一个Android应用程序,我想集成Mapbox,我遵循了以下所有文档: https://docs.mapbox.com/android/maps/guides/install/个
我成功地请求了两个令牌,并在build.gradle中添加了依赖项.
dependencies {
implementation ("com.mapbox.maps:android:10.1.0")
}
问题是当我将以下代码粘贴到settings.gradle中时:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
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
}
}
}
}
URL和BASIC无法识别,我收到几个错误,特别是:
-
意外的标记(使用‘;’分隔同一行上的表达式)
-
未解析的引用:基本
如何在安装过程中解决此问题?