Android studio Bumblebee 中的 Mapbox 依赖项
Mapbox dependency in Android studio Bumblebee
所以正如 mapbox installation guide 中提到的那样,为了将依赖添加到顶层 gradle,应该这样做:
.
但是正如您在图片中看到的那样,它无法构建 gradle,它给了我那个错误。在AndroidStudio Bumblebee.
中项目级别gradle的结构也更改为this
我应该如何将 Mapbox 依赖项添加到我的项目中?
应将 Mapbox 依赖项添加到 settings.gradle 文件中。
可见here.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
//For Mapbox
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 = "<your secret api key>"
}
}
}
}
所以正如 mapbox installation guide 中提到的那样,为了将依赖添加到顶层 gradle,应该这样做:
但是正如您在图片中看到的那样,它无法构建 gradle,它给了我那个错误。在AndroidStudio Bumblebee.
中项目级别gradle的结构也更改为this我应该如何将 Mapbox 依赖项添加到我的项目中?
应将 Mapbox 依赖项添加到 settings.gradle 文件中。
可见here.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
//For Mapbox
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 = "<your secret api key>"
}
}
}
}