Skip to content

Reduce APK File Size

Brianvdb edited this page Dec 23, 2017 · 3 revisions

There are a few ways to reduce your APK file size.

Exclude FFprobe

If you do not use FFprobe in your project it is recommended that you remove the FFprobe library files from your APK build. To do this, add the following packagingOptions block in your app module Gradle.

android {
    ...
    aaptOptions {
        ignoreAssetsPattern "!*ffprobe"
    }
}

Exclude FFmpeg

Similarly, you should exclude FFmpeg library files if you only use FFprobe in your project. To do this, add the following packagingOptions block in your app module Gradle.

android {
    ...
    aaptOptions {
        ignoreAssetsPattern "!*ffmpeg"
    }
}

Exclude architecture

You can also exclude the ARM or x86 architectures and build multiple APK's.

Excluding ARM

android {
    ...
    aaptOptions {
        ignoreAssetsPattern "!arm"
    }
}

Excluding x86

android {
    ...
    aaptOptions {
        ignoreAssetsPattern "!x86"
    }
}
Clone this wiki locally