# Install on Android

> Add the verified 3.0.4 AAR to an Android project and confirm its API, Java, permission, and ARM64 requirements.

> For AI agents: the complete documentation index is at https://nosmai.com/llms/effects.txt

Product: Nosmai Effects
Group: get-started
Source: https://nosmai.com/docs/effects/installation/android/

## 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](/docs/effects/license-key/) bound to the application ID

## Download and verify the AAR

Create the application library directory:

```sh
mkdir -p app/libs
```

Download the native release and checksums from the
[official Android v3.0.4 release](https://github.com/nosmai/nosmai_effects_sdk_android/releases/tag/v3.0.4):

```sh
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:

```sh
shasum -a 256 -c SHA256SUMS
```

The expected AAR SHA-256 is:

```text
4804fc5bf502ca7aff46285562b8d0318d7d14f6ada8a9cb3112fc2188804284
```

Do not rename or use an artifact that fails verification.

## Configure the app module

For Kotlin DSL:

```kotlin
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:

```gradle
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

```xml
<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:

```sh
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:

```java
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](/docs/effects/quickstart/android/) 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](/docs/effects/quickstart/android/)
- [Get and apply a licence key](/docs/effects/license-key/)
- [Check Android capability support](/docs/effects/platform-support/)
- [Apply a beauty filter on Android](/docs/effects/guides/effects/apply-a-beauty-filter/android/)
- [Control a camera game on Android](/docs/effects/guides/effects/control-a-camera-game/android/)

## References

- [Nosmai Android v3.0.4 release](https://github.com/nosmai/nosmai_effects_sdk_android/releases/tag/v3.0.4)
- [Nosmai Effects](https://nosmai.com/effects/)
- [Nosmai Effects pricing](https://nosmai.com/effects/#pricing)
