Skip to content

Most visited

Recently visited

navigation

Set up your build for configuration APKs

You can reduce your app's APK size on each user's device by setting up your build for configuration APKs (config APKs for short). This places your app's DEX code and device-agnostic resources in one APK and each set of device-dependent native code and resources in separate APKs. Devices then request the resources that they need to run your app. In addition to the existing support for screen density and ABI-dependent resources, we now support an additional dimension, language, for Instant Apps. This allows you to reduce the size of your APK by creating multiple APKs that contain files for specific screen density, ABIs, and/or languages.

Prerequisites

Before you set up your build for configuration APKs, review the following steps to make sure your build is ready, and verify you have the tool configuration you need in Android Studio:

Set up your build for configuration APKs

To set up your build for configuration APKs based on languages, add a language block to the splits block of your feature module, and specify generatePureSplits=true in the android block. For more information about configuring the splits block, see Configure your build for multiple APKs.

android {
  ...
  generatePureSplits = true
  splits {
    abi {
      enable = true
    }
    density {
      enable = true
    }
    language {
      enable = true
      include “es”, ”zh”, “en”
    }
  }
}

Troubleshooting and frequently asked questions

Known issue

Currently, we support only one dimension at a time. If you have a resource that varies across multiple dimensions, such as density and language, the resource isn't moved into configuration APKs.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)