Get started Android
1. Prerequisites
To utilise the Weavr Android SDK for Kotlin/Java, you need:
- Android Studio
- Active UI Key from the Embedder Portal
- Weavr Android SDK
Compatibility
- Minimum Android SDK: 24 (Android 7.0 Nougat)
- Target & Compile SDK: 35
- Kotlin: 1.8.0 or newer
Version | Release date | Min OS version |
---|---|---|
3.2 | August 2025 | 24+ |
3.1 | August 2025 | 24+ |
3.0 | June 2025 | 24+ |
2.0 | January 2025 | 24+ |
1.7 | January 2025 | 24+ |
1.6 | June 2024 | 24+ |
2. Installation
Install our Android SDK with Gradle.
2.1 Add dependency
Add the Weavr SDK to your project's build.gradle
:
implementation 'io.weavr.components:secure-components:<latest_version>'
2.2 Configure repositories
The Weavr Android SDK is published to Maven Central. Ensure your repositories
include Maven Central (enabled by default in most Android projects):
repositories {
google()
mavenCentral()
}
- Dependency Management: Ensures your project can resolve both open source and proprietary libraries.
- Flexibility: Integrate multiple SDKs, APIs, or services.
- Security: Stick to secure, well-known repositories to maintain code integrity.
2.3 Add BouncyCastle configuration
In your app module’s build.gradle:
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == "org.bouncycastle") {
details.useTarget("org.bouncycastle:bcprov-jdk15to18:1.68")
}
}
}
Click ‘Sync Now’ in Android Studio to apply.
3. Available environments
The SDK supports multiple environments:
enum class ENV {
PRODUCTION, // Production environment
SANDBOX, // Sandbox/Testing environment
}
4. SDK initialisation
In your Application class or MainActivity:
// Initialize UX Components
UXComponents.initialize(
context = this,
env = ENV.SANDBOX, // or ENV.PRODUCTION
uiKey = "YOUR_UI_KEY"
)
// Initialize Biometric Authentication (only if using PSA features such as
// biometric login, step-up authentication, or enrolment).
UXComponents.psa.initialize(
context = this,
psaENV = PsaENV.SANDBOX, // or PsaENV.PRODUCTION
logger = object : ExceptionLogger {
override fun exception(message: String?, exception: Exception?) {
// Handle exceptions
}
override fun setUserIdentificator(identifier: String?) {
// Set user identifier
}
}
)
Troubleshooting mixed Approov versions
If your build pulls multiple Approov versions transitively, use the following to inspect the dependency graph:
./gradlew app:dependencyInsight --configuration releaseRuntimeClasspath --dependency approov
If multiple versions are present, add Gradle excludes on the dependency that brings the older version. For example:
dependencies {
implementation('io.weavr.components:secure-components:<latest_version>') {
exclude group: 'com.criticalblue', module: 'approovsdk'
}
}
4.1 Build optimisation note
If you’re using R8 full mode in release, you may need to disable it in gradle.properties:
android.enableR8.fullMode=false
This is recommended when integrating the Weavr SDK to ensure all SDK components are properly included in your release builds.
5. Document upload configuration
When using the KYC integration, you can configure the allowed file types for document uploads by adding this to your strings.xml
:
<string name="sns_gallery_type">*/*</string>
This setting controls what types of files users can select from their device's gallery during the KYC process. The default value */*
allows all file types. The SDK supports PDF preview for devices running Android 5.0 (Lollipop) and above.