Skip to content
AOSP Build system compatible version of Open GApps
Makefile Shell Python
Branch: master
Clone or download
nezorflame and mfonville Update
Add info regarding new project reposand move to LFS
Latest commit 96975a8 Nov 5, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
core Properly separate lunzip arguments. Jan 28, 2019
overlay overlay: Define Google Assistant as default Dec 11, 2018
patches Fix issues with Chrome on Lollipop Apr 11, 2016
.gitignore support compatibility for kitkat Dec 9, 2016
LICENSE.txt LICENSE: Add GPLv3 License Oct 20, 2015 Update Nov 5, 2019 Add support for "lzip --decompress" Apr 25, 2018 Minor fixes: Jun 24, 2019

OpenGApps AOSP based build system

++Infrastructure Issues++

05-Nov-2019 Gitlab maintenance: we've recreated all of our package repos (all, arm, arm64, x86, x86_64) from scratch. Please make sure to:

  • install git-lfs (more info here) since we're now using it
  • clean and do a fresh pull before building

25-Feb-2019 Please see Ilya Danilkin's blog post on the main OpenGapps project page that explains GitHub infrastructure issues that affected certain opengapps projects:

In short, the git-remote has changed for the projects all, arm, arm64, x86, x86_64. You should update your manifest entries for those projects (see the updated example below that uses the remote "gitlab").

More discussion on this issue can be found here:


  1. Use this at your own risk. Cyanogenmod received a cease and desist letter from Google when they included Google Apps in their ROM. See: A Note on Google Apps for Android
  2. This project is in no way affiliated with, sponsored by, or related to Google.

Getting started

1. Add the build system, and the wanted sources to your manifest.

Find your manifest file (check inside ${ANDROID_BUILD_TOP}/.repo/manifests/) and add the following towards the end:

<remote name="opengapps" fetch=""  />
<remote name="gitlab" fetch=""  />

<project path="vendor/opengapps/build" name="aosp_build" revision="master" remote="opengapps" />

<project path="vendor/opengapps/sources/all" name="all" clone-depth="1" revision="master" remote="gitlab" />

<!-- arm64 depends on arm -->
<project path="vendor/opengapps/sources/arm" name="arm" clone-depth="1" revision="master" remote="gitlab" />
<project path="vendor/opengapps/sources/arm64" name="arm64" clone-depth="1" revision="master" remote="gitlab" />

<project path="vendor/opengapps/sources/x86" name="x86" clone-depth="1" revision="master" remote="gitlab" />
<project path="vendor/opengapps/sources/x86_64" name="x86_64" clone-depth="1" revision="master" remote="gitlab" />

2. Set the desired OpenGapps variant

In your device/manufacturer/product/ file, in the beginning, add:

GAPPS_VARIANT := <variant>

where <variant> is one of the package types in lowercase. E.g:


3. Include the file

The file will make the Android build system build the necessary PRODUCT_PACKAGES, and include the necessary PRODUCT_COPY_FILES.

In device/manufacturer/product/ file, towards the end, add:

$(call inherit-product, vendor/opengapps/build/

4. Build Android


Adding extra packages

You can add packages from versions higher then your set version. E.g. if you want to include Chrome, but you use GAPPS_VARIANT := micro

In your device/manufacturer/product/ just add, for example:


This uses the module name. You can find the module name for a package by checking vendor/opengapps/build/modules/ and look at the LOCAL_MODULE value.

Excluding packages

You can exclude certain packages from the list of packages associated with your selected OpenGapps variant. E.g. if you have GAPPS_VARIANT := stock and want all those apps installed except for Hangouts, then in your device/manufacturer/product/ just add:


Force stock package overrides

You can force GApps packages to override the stock packages. This can be defined in two ways inside device/manufacturer/product/

For all package:


If you want to include WebViewGoogle on a non-stock build you need:


If you want to include Messenger on a non-stock build you need:


If you want to include Google Dialer on a non-stock build you need:


If you want to include Chrome on a non-full build you need:


PixelLauncher is the default launcher in Oreo builds (and newer); in builds older than Oreo, the default launcher is GoogleNow. If desired, then you can force PixelLauncher to be used by setting the following variable:


On a per-app basis, add the GApps package to GAPPS_PACKAGE_OVERRIDES. Example:


Disable stock packages overrides

You can tell the GApps packages not to override the stock packages. This can be defined inside device/manufacturer/product/ by adding the GApps package to GAPPS_BYPASS_PACKAGE_OVERRIDES. Example:


Force the system to get the correct DPI package for your device

By default, the latest package version will be selected with the closest DPI. You can force the system to select either a matching DPI package or "nodpi" package even if it is not the latest version.

This can be defined inside device/manufacturer/product/ using:


DEX pre-optimization

It is possible to build Android with dex preoptimization. This results in a quicker boot time, at the cost of additional storage used on /system.

This is normally done by setting the value:


in This will, by default, if set to true, also enable DEX Preoptimization for Google Apps.

You can disable this entirely by setting:


How it works

When building in an AOSP tree, the build system processes the file device/manufacturer/product/ very early, which means that the file vendor/opengapps/build/ is also processed very early. This causes two special build "functions" (generic build rules) to be defined before any files are read:


The definitions use the already existing AOSP build infrastructure for prebuilt APKs and SHARED_LIBRARYs, but remove a lot of the boilerplate.

The build rules take care of locating the correct APK/libraries in an architecture-independent way. The AOSP based build system already prioritizes SoC architecture. E.g. if it finds an apk in sources/arm64 and sources/arm, it will automatically prioritize sources/arm64.

The APK rule will also scan the APK for any libraries, and if it finds libraries it will get the AOSP build system to automatically extract them and place them at the expected place.


Some modules are missing overrides

With reference to the package comparison, currently only package overrides has been setup for a GAPPS_VARIANT of micro or lower, + Chrome.

Pull requests to add package overrides for more modules is welcome. See modules/Chrome/ for an example.

Chrome on Lollipop requires an extra patch

Run these commands:

cd build
curl | git am -

(Patch only tested on 5.1.1 r37).

You can’t perform that action at this time.