Closed samuele-lolli closed 1 year ago
If using kts
, you can set it up like this
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
authentication {
create<BasicAuthentication>("basic")
}
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
}
}
}
}
thank you!
I'm developing an android application with java and I want to integrate Mapbox, I followed all the documentation here: https://docs.mapbox.com/android/maps/guides/install/
I requested both tokens successfully and added the dependency in the build.gradle.kts:
The problem is when I insert the following code into settings.gradle.kts:
url and basic are not recognized by android studio and I get several errors, in particular:
I used Java for the project but the gradle files have the kts extensione because when i create the project i select the java language but build with kotlin.