Install on Android
Use your Mobai read-only access token to download bio.mobai:biometric:2.3.3 from the private Cloudsmith Maven repository. To get a token, contact support at support@mobai.bio. Use Gradle for a complete Android app build; Maven download instructions are also below.
Starting with version 2.3.3, Mobai distributes the Android SDK from Cloudsmith. If your app uses the earlier public Maven repository https://gitlab.com/api/v4/projects/36441060/packages/maven, remove that repository from your Gradle configuration, add the Cloudsmith repository as described below, and change the dependency to bio.mobai:biometric:2.3.3. The group and artifact names are unchanged. The only source change is that MBTargetResolution.QHD was removed in 2.3.3; use MBTargetResolution.HD_720 instead. See the SDK changelog.
Gradle
1. Store your access token
Add this line to your user-level ~/.gradle/gradle.properties file:
mobaiCloudsmithToken=YOUR_MOBAI_ACCESS_TOKEN
Replace the placeholder with the token supplied by Mobai. This file is outside your app repository. For CI, supply the token as a secret environment variable named MOBAI_ACCESS_TOKEN instead; do not leave an empty mobaiCloudsmithToken property, because it takes precedence over the environment variable.
2. Add the private repository
In settings.gradle.kts, add the Mobai Maven repository inside your existing dependencyResolutionManagement.repositories block:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
name = "MobaiCloudsmith"
url = uri("https://dl.cloudsmith.io/basic/mobai/sdks/maven/")
credentials {
username = "token"
password = providers.gradleProperty("mobaiCloudsmithToken")
.orElse(providers.environmentVariable("MOBAI_ACCESS_TOKEN"))
.getOrElse("")
}
content {
includeGroup("bio.mobai")
}
}
}
}
Merge this with an existing repositories block instead of adding a second one. The repository URL is safe to commit because it contains no token.
3. Add and resolve the SDK
In your app module's build.gradle.kts:
dependencies {
implementation("bio.mobai:biometric:2.3.3")
}
Sync the project in Android Studio or run ./gradlew :app:assembleDebug. The published Android 2.3.3 library uses Kotlin 2.1 metadata; if your app reports an incompatible Kotlin metadata version, update its Kotlin Gradle plugin to 2.1.0 or a compatible newer version. For projects using the Gradle 8.7 wrapper, select JDK 17 or 21 as the Gradle JVM.
Maven
The same Android release is published as an Android Archive (.aar). Maven can download the artifact with your Mobai access token. Declare the repository and AAR dependency in pom.xml, and keep the token in your user-level Maven settings.
Cloudsmith's package page shows an API-key example using a Cloudsmith account username. That is for account holders. If Mobai supplied you with a read-only access token, use token as the username and your Mobai token as the password, as shown below. The repository ID is a local name: this guide uses mobai-cloudsmith; Cloudsmith's mobai-sdks also works if the IDs in pom.xml and settings.xml match.
The AAR download works, but the published dependency graph currently has conflicting AndroidX version requirements under Maven. A full mvn dependency:resolve fails on those transitive dependencies. Use the Gradle setup for a complete Android app build until a Maven-compatible dependency graph is published.
1. Add the repository and dependency
Merge these entries into your existing pom.xml:
<repositories>
<repository>
<id>mobai-cloudsmith</id>
<url>https://dl.cloudsmith.io/basic/mobai/sdks/maven/</url>
</repository>
<repository>
<id>google</id>
<url>https://maven.google.com/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>bio.mobai</groupId>
<artifactId>biometric</artifactId>
<version>2.3.3</version>
<type>aar</type>
</dependency>
</dependencies>
The google repository supplies AndroidX dependencies; omit it here if your build already provides it. The mobai-cloudsmith ID must match the server ID in the next step. Use <repositories> for downloading dependencies, not <distributionManagement>, which is for publishing.
The published 2.3.3 POM declares aar packaging. Keep <type>aar</type> even though Cloudsmith's generic Maven dependency example omits it; otherwise Maven looks for a JAR.
2. Add your access token
Add a matching <server> entry to your user-level ~/.m2/settings.xml (create the file if needed; preserve any existing settings):
<settings>
<servers>
<server>
<id>mobai-cloudsmith</id>
<username>token</username>
<password>${env.MOBAI_ACCESS_TOKEN}</password>
</server>
</servers>
</settings>
Set MOBAI_ACCESS_TOKEN to the read-only token supplied by Mobai in your local build environment or CI secret store. Maven reads it when resolving the dependency. Alternatively, put the token directly in this user-level settings file and restrict the file to your user (chmod 600 ~/.m2/settings.xml). Never commit either the token or a populated settings file.
To verify authenticated access and download the AAR without its transitive dependencies, run this from the project directory:
mvn dependency:get -Dartifact=bio.mobai:biometric:2.3.3:aar -Dtransitive=false
This checks the package download only; it does not build an Android app or supply the AndroidX dependencies. The Kotlin compiler compatibility note in the Gradle section also applies to any build compiling Kotlin against this release.
Cloudsmith's generic mvn install command builds a Maven project after resolving its dependencies. For this 2.3.3 release, the transitive dependency conflict noted above currently prevents that full Maven build.
Troubleshooting
- 401, 403, or “package not found”: confirm that the token is present, still active, and grants access to
mobai/sdks. Private packages can appear missing when authentication fails. - Wrong package coordinate or version: use
bio.mobai:biometric:2.3.3and confirm the release is available to your token.
For more detail, see Cloudsmith's Gradle repository guide, Maven repository guide, and entitlement token guide.