Skip to content

Reducing App Size on Android

The Client SDK increases app size mainly because of the bundled WebRTC and noise suppression native libraries. For background on where the size comes from, see Client SDK App Size.

A universal APK bundles the native libraries for every CPU architecture, which is what produces the largest figures. The recommendations below shrink what each user actually downloads.

1. Ship an App Bundle (.aab) instead of a universal APK

The single most impactful optimization is to publish an Android App Bundle (.aab) rather than a universal APK. With an App Bundle, Google Play delivers only the architecture-specific native libraries each device needs, which roughly halves the native library size.

  • Using an App Bundle, the SDK adds no more than ~12 MB to your app.
  • This can reduce the effective APK size by more than 66% compared to a universal APK.

This is the recommended distribution format for Google Play and requires no code changes.

2. ABI splits (optional)

If you are not using App Bundles, configure ABI splits to exclude emulator-only architectures (x86 and x86_64). Real-world devices use arm64-v8a or armeabi-v7a, so shipping those slices alone significantly reduces size.

Reference size comparison by ABI:

Build typeDownload sizeAPK size
Universal APK~18.7 MB~45.2 MB
x86_64 APK~7 MB~15.1 MB
arm64-v8a APK~6.8 MB~14 MB
armeabi-v7a APK~6 MB~9.9 MB
kotlin
android {
    splits {
        abi {
            isEnable = true
            reset()
            include("arm64-v8a", "armeabi-v7a")
            isUniversalApk = false
        }
    }
}

TIP

Prefer an App Bundle over manual ABI splits where possible — Play handles the per-device delivery for you and avoids maintaining multiple APK artifacts.

3. Enable R8 / code shrinking

Enable R8 (the default code shrinker in the Android Gradle Plugin) in your release build to strip unused code and resources. This reduces overall app size beyond just the SDK contribution.

kotlin
android {
    buildTypes {
        release {
            isMinifyEnabled = true
            isShrinkResources = true
        }
    }
}

When shrinking is enabled, keep the SDK's classes to avoid runtime issues. See ProGuard Rules for the required keep configuration.

4. extractNativeLibs (optional)

Setting extractNativeLibs can reduce the download size of the APK:

xml
<application
    android:extractNativeLibs="true">
</application>

Be aware this may result in a slightly longer installation time on the device. Evaluate this trade-off based on your users' expectations.

Summary

RecommendationImpact
App Bundle (.aab)Reduces SDK footprint to ~12 MB
ABI splits (exclude x86/x86_64)Removes emulator-only slices
R8 code shrinkingStrips unused code
extractNativeLibs (optional)Reduces download size

Built with VitePress.