Migration to 7.1.x version
This migration guide applies to all users upgrading to version 7.1.0 or later who were previously using MobbID SDK via .aar files.
Starting from version 7.1.0, MobbID Android SDK distribution method has changed from manual .aar file inclusion to a private Maven repository. This is a breaking change that requires updating your project configuration.
Migration steps
1. Remove AAR files from libs folder
Delete all MobbID-related .aar files from your project's libs folder:
libs/
- mobbid-core-X.Y.Z.aar (delete)
- mobbid-face-X.Y.Z.aar (delete)
- mobbid-face-ux-X.Y.Z.aar (delete)
- [any other MobbID AAR files provided by Mobbeel]
2. Remove flatDir configuration
Remove the flatDir repository configuration from your build.gradle file:
Remove this section:
repositories {
...
flatDir {
dirs 'libs'
}
...
}
Result should be:
repositories {
mavenCentral()
// other repositories...
}
3. Configure Maven repository
Add the MobbID private Maven repository to your settings.gradle.kts (recommended) or build.gradle file:
In settings.gradle.kts:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://repository.mobbeel.com/repository/release/")
credentials {
username = "YOUR_CLIENT_ID"
password = "YOUR_CLIENT_PASSWORD"
}
}
}
}
Important: Replace
YOUR_CLIENT_IDandYOUR_CLIENT_PASSWORDwith the credentials provided by Mobbeel. Contact Mobbeel support if you don't have these credentials.
4. Replace AAR dependencies with Maven implementations
Remove all AAR-based dependencies from your dependencies block and replace them with Maven implementations.
Before (AAR-based):
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar"))))
// Or specific AAR references like:
implementation(name: 'mobbid-core', version: 'X.Y.Z', ext: 'aar')
implementation(name: 'mobbid-face', version: 'X.Y.Z', ext: 'aar')
implementation(name: 'mobbid-face-ux', version: 'X.Y.Z', ext: 'aar')
}
After (Maven-based):
dependencies {
// Core SDK (required)
implementation("com.mobbeel.mobbid:core:7.1.0")
// Face module (optional - only if you use face biometrics)
implementation("com.mobbeel.mobbid:face:7.1.0")
// Face UX module (optional - only if you use the pre-built UI components)
implementation("com.mobbeel.mobbid:face-ux:7.1.0")
}
Note: All third-party dependencies are now managed automatically by Gradle. You don't need to specify them manually.
Using version catalogs (optional)
If you prefer using Gradle version catalogs, add the following to your libs.versions.toml:
[versions]
mobbid = "7.1.0"
[libraries]
mobbid-sdk-core = { module = "com.mobbeel.mobbid:core", version.ref = "mobbid" }
mobbid-sdk-face = { module = "com.mobbeel.mobbid:face", version.ref = "mobbid" }
mobbid-sdk-face-ux = { module = "com.mobbeel.mobbid:face-ux", version.ref = "mobbid" }
Then in your build.gradle.kts:
dependencies {
implementation(libs.mobbid.sdk.core)
implementation(libs.mobbid.sdk.face)
implementation(libs.mobbid.sdk.face.ux)
}
5. Update ProGuard rules (if applicable)
If you use ProGuard or R8 in your release builds, update your proguard-rules.pro file with the simplified rules:
# MobbID rules
-keep class com.mobbeel.mobbid.** { *; }
-dontwarn com.mobbeel.mobbid.**
-keepattributes *Annotation*, Exceptions, Deprecated, Signature, MethodParameters, InnerClasses
# Keep native methods
-keepclasseswithmembernames class * {
native <methods>;
}
# Keep Parcelable implementations
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
# Protobuf rules
-keep public class com.google.protobuf.** { *; }
You can remove old rules related to:
- AAR-specific keep rules
- Third-party libraries that were manually managed
6. Clean and rebuild
After making all changes, clean your project and rebuild:
./gradlew clean
./gradlew build
7. Test the migration
Thoroughly test your application to ensure all SDK functionality works correctly:
- Face enrollment
- Face verification
- Face identification
- Liveness detection (if used)
- License validation
Benefits of the new distribution method
- Automatic dependency management: Gradle automatically resolves and downloads all required dependencies
- Version consistency: Ensures all third-party libraries are compatible
- Easier updates: Simply change the version number in the dependency declaration
- Smaller project size: No need to bundle AAR files in your source control
Troubleshooting
Gradle sync fails with authentication error
Ensure you have correctly configured the Maven credentials:
- Verify the
usernameandpasswordare correct - Contact Mobbeel support if you don't have credentials
ProGuard errors after migration
- Remove all old ProGuard rules related to AAR files
- Use only the simplified rules provided in this guide
- Make sure you have removed AAR-specific keep rules
Missing classes at runtime
- Make sure you have removed the
flatDirconfiguration - Verify all AAR files are deleted from
libsfolder - Clean and rebuild the project
Dependency conflicts
If you encounter dependency conflicts with other libraries:
- Check your project's dependency tree:
./gradlew dependencies - Use dependency resolution strategies if needed
Need help?
If you encounter any issues during the migration, contact Mobbeel support with:
- Your current SDK version
- The error message or log output
- Relevant configuration files (build.gradle, proguard-rules.pro)
