Client SDK App Size — Best Practices Client SDK App Size — Best Practices

Client SDK App Size — Best Practices

Vonage API Support

Symptom

Customers integrating the Vonage Client SDK into their mobile applications may notice an increase in their app size. This is primarily due to two core dependencies bundled within the SDK:

  • WebRTC — the largest contributor to SDK size, required for all voice functionality
  • Noise suppression library — adds an optional feature but contributes significantly to overall size

These dependencies are fundamental to the SDK's voice capabilities. While the Vonage engineering team is actively working on SDK optimisations (e.g., upgrading tooling, bumping dependencies), some size increase is unavoidable due to the WebRTC dependency. In the meantime, developers can adopt the following best practices to minimise the impact on their app size.

Observed Size Impact

When integrating the Vonage Client SDK (In-App Voice only), customers can expect the following approximate increases in app size:

Platform Approximate Size Increase
Android ~25 MB (universal APK)
iOS ~14.5 MB

Note: These figures reflect a universal/unoptimized build. Applying the recommendations below can significantly reduce the effective download size for end users.

Applies To

  • Client SDK
  • Android
  • iOS

Resolution

Android Recommendations

1. Ship an App Bundle (.aab) Instead of a Universal APK

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

  • Using App Bundle, the SDK adds roughly half the native size.
  • This can reduce the overall APK size by more than 66% compared to a universal APK.

2. ABI Splits (Optional)

If not using App Bundles, consider configuring 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.

3. Enable R8 / Code Shrinking

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

4. Use extractNativeLibs (Optional)

Setting extractNativeLibs can reduce the download size of the APK. However, be aware that this may result in a slightly longer installation time on the device. Evaluate this trade-off based on your users' expectations.

 

iOS Recommendations

1. App Store Thinning (Automatic)

The Apple App Store automatically performs App Thinning, delivering only the device-specific slice to each user. This means the 14.5 MB figure already reflects a near-optimal download size for real devices — it is close to the floor for iOS today.

2. Enable Dead-Code Stripping

Ensure the following build settings are enabled in your Release scheme in Xcode:

  • Strip Linked Product (STRIP_INSTALLED_PRODUCT = YES)
  • Dead Code Stripping (DEAD_CODE_STRIPPING = YES)

These settings remove unused symbols and code from the final binary, reducing the shipped binary size.

3. Exclude Simulator Slices from Production Builds

Verify that your production/Release build does not bundle simulator slices (x86_64, i386). Simulator architectures should only be present in Debug/development builds. Shipping a build with simulator slices unnecessarily inflates the app size for end users.

 

Summary of Recommendations

Platform Recommendation Impact
Android Use App Bundle (.aab) Reduces SDK footprint to ~12 MB
Android ABI splits (exclude x86/x86_64) Removes emulator-only slices
Android Enable R8 code shrinking Strips unused code
Android extractNativeLibs (optional) Reduces download size
iOS App Store Thinning Automatic — already applied
iOS Enable Strip Linked Product / Dead Code Stripping Reduces binary size
iOS Exclude simulator slices in Release Prevents unnecessary bloat

 

Cause

The size increase is inherent to the SDK's dependencies:

  • The WebRTC library is responsible for the majority of the SDK size and is required for all voice features.
  • The noise suppression library is optional in terms of features but is currently bundled and contributes to size.

The Vonage SDK team is aware of these concerns and has planned work to optimise SDK size on both platforms, including using the latest build tools and updating dependencies. However, due to the nature of the WebRTC dependency, some size increase will always be present.

Additional Information