We're only supporting mapbox 10.16* and 11.. The default is 10.16. Next release will be 11.* only so we recommend updatign to 11.*
You will need to authorize your download of the Maps SDK via a secret access token with the DOWNLOADS:READ
scope.
This guide explains how to Configure credentials
and Configure your secret token
.
Then under section allprojects/repositories
add your data:
// android/build.gradle
allprojects {
repositories {
// ...other repos
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 = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
}
}
// ...even more repos?
}
}
Warning: If you set a custom version, make sure you revisit, any time you update @rnmapbox/maps. Setting it to earlier version than what we exepect will likely result in a build error.
Set RNMapboxMapsVersion
in android/build.gradle > buildscript > ext
section
buildscript {
ext {
RNMapboxMapsVersion = '11.1.0'
}
}
you can also customize all the libraries, should it be neccesary
buildscript {
ext {
// ...
RNMapboxMapsLibs = { // optional - only required if you want to customize it
implementation 'com.mapbox.maps:android:10.6.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:5.4.1'
}
}
}
buildscript {
ext {
RNMapboxMapsVersion = '11.0.0'
}
}
If you see 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs
issue see possible workaround.
code android/app/build.gradle
add the following
android {
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
}