Migration to 2.29.x version
This migration guide applies to all users upgrading to version 2.29.x or later who were previously using MobbScan SDK via .aar files.
Starting from version 2.29.x, MobbScan 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 .aar files from your project's libs folder:
libs/
- mobbscan-sdk-android-X.Y.Z.aar (delete)
- mobbscan-video-android-X.Y.Z.aar (delete)
- mobbscan-nfc-extension-android-X.Y.Z.aar (delete)
- mobb-commons-android-X.Y.Z.aar (delete)
- cameraviewplus-X.Y.Z.aar (delete)
- mobbscan-detector-X.Y.Z.aar (delete)
- opencv-android-X.Y.Z.aar (delete)
- [any other 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 MobbScan private Maven repository to your build.gradle file:
repositories {
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(name: 'mobb-commons-android', version: 'X.Y.Z', ext: 'aar')
implementation(name: 'mobbscan-sdk-android', version: 'X.Y.Z', ext: 'aar')
implementation(name: 'cameraviewplus', version: 'X.Y.Z', ext: 'aar')
implementation(name: 'mobbscan-detector', version: 'X.Y.Z', ext: 'aar')
// Third-party libraries
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.20'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'com.rmtheis:tess-two:9.1.0'
implementation 'com.madgag.spongycastle:prov:1.54.0.0'
implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation(name: 'opencv-android-3.4.6', ext: 'aar')
// Video module (if used)
implementation(name: 'mobbscan-video-android-X.Y.Z', ext: 'aar')
implementation 'com.twilio:video-android:7.6.1'
// NFC module (if used)
implementation(name: 'mobbscan-nfc-extension-android', version: 'X.Y.Z', ext: 'aar')
implementation 'org.jmrtd:jmrtd:0.7.18'
implementation 'net.sf.scuba:scuba-sc-android:0.0.20'
}
After (Maven-based):
dependencies {
// Core SDK
implementation 'com.mobbeel:mobbscan-sdk-android:2.29.0'
// Video module (optional - only if you use video recording)
implementation 'com.mobbeel:mobbscan-video-android:2.29.0'
// NFC module (optional - only if you use NFC reading)
implementation 'com.mobbeel:mobbscan-nfc-extension-android:2.29.0'
}
Note: All third-party dependencies are now managed automatically by Gradle. You don't need to specify them manually.
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:
# MobbScan rules
-keep class com.mobbeel.** { *; }
-dontwarn com.mobbeel.**
-keepattributes *Annotation*, InnerClasses
-dontnote retrofit2.Platform
# Gson rules
-keep class com.google.gson.** { *; }
-dontwarn sun.misc.**
-keep class com.google.gson.stream.** { *; }
# EventBus rules
-keepclassmembers class * {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# Twilio Video rules (only if using video module)
-keep class tvi.webrtc.** { *; }
-keep class org.webrtc.** { *; }
-keep class com.twilio.video.** { *; }
-keepattributes InnerClasses
# NFC rules (only if using NFC module)
-keep class net.sf.scuba.smartcards.** { public *; }
-dontwarn de.tsenger.androsmex.**
-dontwarn jj2000.**
-dontwarn com.fasterxml.jackson.**
You can remove old rules related to:
- OpenCV
- Tesseract
- Spongycastle/Bouncycastle
- MobbCommons
- Other AAR-specific rules
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:
- Document scanning (front and back)
- OCR extraction
- Face matching (if used)
- Video recording (if used)
- NFC reading (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
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)
