This repository contains the Carto Mobile SDK for Android, distributed via GitHub Packages.
Starting in the 5 version. This version add 16Kb page size to the arm64 compilation.
- Group ID:
com.carto - Artifact ID:
carto-mobile-sdk - Version:
5.0.0 - Repository: GitHub Packages
Add the following to your settings.gradle file:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
// Add GitHub Packages repository
maven {
url = uri("https://maven.pkg.github.com/CartoDB/android-carto-mobile-sdk-version")
credentials {
username = providers.gradleProperty("gpr.usr").getOrElse(System.getenv("GPR_USER"))
password = providers.gradleProperty("gpr.key").getOrElse(System.getenv("GPR_API_KEY"))
}
}
}
}Add the following to your root build.gradle file:
allprojects {
repositories {
google()
mavenCentral()
// Add GitHub Packages repository
maven {
url = uri("https://maven.pkg.github.com/CartoDB/android-carto-mobile-sdk-version")
credentials {
username = project.findProperty("gpr.usr") ?: System.getenv("GPR_USER")
password = project.findProperty("gpr.key") ?: System.getenv("GPR_API_KEY")
}
}
}
}Create a github.properties file in your project's root directory:
gpr.usr=your-github-username
gpr.key=your-github-personal-access-tokenImportant:
- Your GitHub Personal Access Token must have at least
read:packagespermission - Add
github.propertiesto your.gitignorefile to keep credentials secure
# Add this to your .gitignore
github.propertiesIn your app module's build.gradle file, add the dependency:
dependencies {
implementation 'com.carto:carto-mobile-sdk:5.0.0'
// ... other dependencies
}Sync your project in Android Studio or run:
./gradlew buildFor CI/CD pipelines or if you prefer not to use a properties file, you can set environment variables:
export GPR_USER=your-github-username
export GPR_API_KEY=your-github-tokenThe repository configuration will automatically fall back to these environment variables if the github.properties file is not found.
- Go to GitHub Settings > Developer Settings > Personal Access Tokens
- Click "Generate new token (classic)"
- Give it a descriptive name (e.g., "Android Package Access")
- Select the
read:packagesscope (orwrite:packagesif you need to publish) - Click "Generate token"
- Copy the token immediately (you won't be able to see it again)