Prerequisites
- An Android application with minimum API 21 or later
- Android compile SDK 35 for the current integration baseline
- Java 11 bytecode compatibility
- A physical device whose ABI list contains
arm64-v8a - A Nosmai licence key bound to the application ID
Download and verify the AAR
Create the application library directory:
mkdir -p app/libs
Download the native release and checksums from the official Android v3.0.4 release:
curl -L \ -o app/libs/nosmai-sdk-3.0.4.aar \ https://github.com/nosmai/nosmai_effects_sdk_android/releases/download/v3.0.4/nosmai-sdk-3.0.4.aar curl -L \ -o SHA256SUMS \ https://github.com/nosmai/nosmai_effects_sdk_android/releases/download/v3.0.4/SHA256SUMS
Verify the release:
shasum -a 256 -c SHA256SUMS
The expected AAR SHA-256 is:
4804fc5bf502ca7aff46285562b8d0318d7d14f6ada8a9cb3112fc2188804284
Do not rename or use an artifact that fails verification.
Configure the app module
For Kotlin DSL:
android {
compileSdk = 35
defaultConfig {
minSdk = 21
ndk {
abiFilters += listOf("arm64-v8a")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies {
implementation(files("libs/nosmai-sdk-3.0.4.aar"))
}
For Groovy DSL:
android {
compileSdkVersion 35
defaultConfig {
minSdkVersion 21
ndk {
abiFilters 'arm64-v8a'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
dependencies {
implementation files('libs/nosmai-sdk-3.0.4.aar')
}
The AAR contains consumer R8 rules for the public API, JNI entry points, frame callbacks, and cloud response types. Keep the app's normal release minification configuration and inspect the merged rules when adding custom shrinking rules.
Add Android permissions
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:allowBackup="true"
android:label="CameraApp"
android:theme="@style/Theme.CameraApp" />
</manifest>
Request CAMERA at runtime before opening Camera2. Request RECORD_AUDIO only before recording audio. Internet access is used for licence verification and Cloud Filters.
Confirm the device ABI
Connect the device and run:
adb shell getprop ro.product.cpu.abilist
The result must contain arm64-v8a. It is valid for the list to contain 32-bit fallback ABIs as well. A 32-bit-only device cannot install this release.
AAR size
The 3.0.4 AAR is 53,876,984 bytes, about 51.4 MiB. This is not the final Play Store download increase. App Bundle ABI delivery, compression, existing shared dependencies, symbols, and bundled .nosmai assets affect the result.
Build a signed release App Bundle and inspect its device-specific download size in Play Console before publishing.
Verify it worked
Add a version log after application startup:
import android.util.Log;
import com.nosmai.effect.api.NosmaiSDK;
Log.i("CameraApp", "Nosmai version: " + NosmaiSDK.getVersion());
Build and install on an ARM64 device. A successful launch with version 3.0.4 confirms Java classes and native libraries are packaged. Continue to the Android quickstart to initialize, connect Camera2, and apply skin smoothing.
Common errors
| Error | Cause | Fix |
|---|---|---|
Could not find com.nosmai or package com.nosmai.effect.api does not exist | App module does not reference the AAR path | Put the verified file in app/libs and add implementation(files("libs/nosmai-sdk-3.0.4.aar")) |
INSTALL_FAILED_NO_MATCHING_ABIS | Device or build does not support arm64-v8a | Use an ARM64 physical device and retain the ABI filter |
UnsatisfiedLinkError | AAR is missing, corrupted, duplicated, or stripped incorrectly | Verify SHA-256, keep one AAR copy, and inspect the packaged native libraries |
License key cannot be null or empty | Build configuration did not supply the licence key | Provide the app-bound key before NosmaiSDK.initialize |
Cleartext HTTP traffic not permitted | App is loading a development asset over HTTP | Use HTTPS or an explicit development-only network security configuration |
Next steps
- Add real-time camera effects to an Android app
- Get and apply a licence key
- Check Android capability support
- Apply a beauty filter on Android
- Control a camera game on Android