---
updatedAt: 2025-02-13T17:52:35.000Z
agentTools:
  projectIndex: https://docs.emergetools.com/llms.txt
---

# Multiple native library architectures (Android)

If multiple native library architectures are included in the APK(s) users download, Emerge will suggest you remove native libraries from architectures that are unsupported on our baseline device (arm64-v8a - Google Pixel 3, Android 12).

Users only need the native libraries specific to their device's application binary interface (ABI). Including ABIs that aren't supported by a device introduces a significant amount of unnecessary bloat, and can easily and safely be removed.

## How to resolve

There are a few scenarios in which end-users would receive multiple native library architectures on their device:

* If receiving a Universal APK from the Play Store
* If ABI splits are disabled for generated AABs
* If manual splits are configured and the ABI split is disabled

### Universal APKs

It's not actually possible to *remove* additional ABIs from Universal APKs, as by the name, Universal APKs are intended to support any device.

If shipping to the Play Store, Emerge recommends shipping AABs rather than single, Universal APKs. AABs offer significant app size advantages over Universal APKs, and Google Play [requires new apps to publish AABs](https://developer.android.com/guide/app-bundle).

For more reading about the app size advantages of AABs, read [Emerge's additional documentation on Split APKs](https://www.emergetools.com/glossary/split-apks).

### ABI split AAB opt-out

AABs can be configured in the Android Gradle Plugin's `android {}` block with the `bundle {}` block. By default, all splits are enabled, but any split (density, ABI, language) can be disabled manually.

To ensure users are receiving only the APKs split from the AAB that include only the native libraries necessary for their device, ensure the `splitEnabled` field inside the `abi {}` block is set to `true`, or not present, as the default value is `true`.

```kotlin build.gradle.kts
android {
  bundle {
    ..
    
    abi {
      splitEnabled.set(true) // Or can be removed, as default is true
    }
  }
}
```
```groovy build.gradle
android {
  bundle {
    ..
    
    abi {
      splitEnabled = true // Or can be removed, as default is true
    }
  }
}
```

More documentation on the `bundle {}` configuration block can be found [here](https://developer.android.com/guide/app-bundle/configure-base#disable_config_apks).

### Manual splits

Similar to the ABI split AAB opt-out with the `bundle {}` block, the `split {}` block can be used to output split APKs manually. If configured to skip ABI splits, Android will package all native library architectures into the main split.

Ensure your split Gradle dls config has the `isEnabled = true` field set for the `abi {}` block.

```kotlin build.gradle.kts
android {
  splits {
    ..
    
    abi {
      isEnabled.set(true)
    }
  }
}
```
```groovy build.gradle
android {
  splits {
    ..
    
    abi {
      isEnabled = true
    }
  }
}
```

More information about the ABI configuration for manual APK splits can be found [here](https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split).