05-Nov-2019 Gitlab maintenance: we've recreated all of our package repos [
GAPPS_VARIANT :=
- from scratch. Please make sure to:
- install GAPPS_VARIANT := 9 [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:
//opengapps.org/blog/post/2019/02/17/github-situation/
In short, the git-remote has changed for the projects
GAPPS_VARIANT :=
8. 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:
opengapps/opengapps
719
Disclaimer
- 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
- 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
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
- and add the following towards the end:
arm64 depends on arm >
2. Set the desired OpenGapps variant
In your
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
2 file, in the beginning, add:
GAPPS_VARIANT :=
where
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
3 is one of the package types in lowercase. E.g:
3. Include the opengapps-packages.mk file
The
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
4 file will make the Android build system build the necessary
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
5, and include the necessary
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
6.
In
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
2 file, towards the end, add:
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
4. Install git LFS and pull in all dependencies
More info: //github.com/git-lfs/git-lfs/blob/master/INSTALLING.md
Apt/deb
sudo apt install git-lfs
Yum/rpm
sudo yum install git-lfs
on macOS
brew install git-lfs git lfs install repo forall -c git lfs pull
5. Build Android
Customizations
Adding extra packages
You can add packages from versions higher then your set version. E.g. if you want to include
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
8, but you use
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
9
In your
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
2 just add, for example:
GAPPS_PRODUCT_PACKAGES += Chrome
This uses the module name. You can find the module name for a package by checking
More info: //github.com/git-lfs/git-lfs/blob/master/INSTALLING.md
Apt/deb
sudo apt install git-lfs
Yum/rpm
sudo yum install git-lfs
on macOS
brew install git-lfs git lfs install repo forall -c git lfs pull
1 and look at the
More info: //github.com/git-lfs/git-lfs/blob/master/INSTALLING.md
Apt/deb
sudo apt install git-lfs
Yum/rpm
sudo yum install git-lfs
on macOS
brew install git-lfs git lfs install repo forall -c git lfs pull
2 value.
Excluding packages
You can exclude certain packages from the list of packages associated with your selected OpenGapps variant. E.g. if you have
More info: //github.com/git-lfs/git-lfs/blob/master/INSTALLING.md
Apt/deb
sudo apt install git-lfs
Yum/rpm
sudo yum install git-lfs
on macOS
brew install git-lfs git lfs install repo forall -c git lfs pull
3 and want all those apps installed except for
More info: //github.com/git-lfs/git-lfs/blob/master/INSTALLING.md
Apt/deb
sudo apt install git-lfs
Yum/rpm
sudo yum install git-lfs
on macOS
brew install git-lfs git lfs install repo forall -c git lfs pull
4, then in your
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
2 just add:
GAPPS_EXCLUDED_PACKAGES := Hangouts
Force stock package overrides
You can force GApps packages to override the stock packages. This can be defined in two ways inside
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
2.
For all package:
GAPPS_FORCE_PACKAGE_OVERRIDES := true
If you want to include WebViewGoogle on a non-stock build you need:
GAPPS_FORCE_WEBVIEW_OVERRIDES := true
If you want to include Messenger on a non-stock build you need:
GAPPS_FORCE_MMS_OVERRIDES := true
If you want to include Google Dialer on a non-stock build you need:
GAPPS_FORCE_DIALER_OVERRIDES := true
If you want to include Chrome on a non-full build you need:
GAPPS_VARIANT :=
0
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:
GAPPS_VARIANT :=
1
On a per-app basis, add the GApps package to
More info: //github.com/git-lfs/git-lfs/blob/master/INSTALLING.md
Apt/deb
sudo apt install git-lfs
Yum/rpm
sudo yum install git-lfs
on macOS
brew install git-lfs git lfs install repo forall -c git lfs pull
7. Example:
GAPPS_VARIANT :=
2
Disable stock packages overrides
You can tell the GApps packages not to override the stock packages. This can be defined inside
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
2 by adding the GApps package to
More info: //github.com/git-lfs/git-lfs/blob/master/INSTALLING.md
Apt/deb
sudo apt install git-lfs
Yum/rpm
sudo yum install git-lfs
on macOS
brew install git-lfs git lfs install repo forall -c git lfs pull
9. Example:
GAPPS_VARIANT :=
3
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
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
2 using:
GAPPS_VARIANT :=
4
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
GAPPS_PRODUCT_PACKAGES += Chrome
1.
This is normally done by setting the value:
in
GAPPS_PRODUCT_PACKAGES += Chrome
2. This will, by default, if set to true, also enable DEX Preoptimization for Google Apps.
You can disable this entirely by setting:
GAPPS_VARIANT :=
5
How it works
When building in an AOSP tree, the build system processes the file
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
2 very early, which means that the file
GAPPS_PRODUCT_PACKAGES += Chrome
4 is also processed very early. This causes two special build "functions" [generic build rules] to be defined before any Android.mk files are read:
GAPPS_VARIANT :=
6
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
GAPPS_PRODUCT_PACKAGES += Chrome
5 and
GAPPS_PRODUCT_PACKAGES += Chrome
6, it will automatically prioritize
GAPPS_PRODUCT_PACKAGES += Chrome
5.
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.
Caveats
Some modules are missing overrides
With reference to the package comparison, currently only package overrides has been setup for a
GAPPS_PRODUCT_PACKAGES += Chrome
8 of
GAPPS_PRODUCT_PACKAGES += Chrome
9 or lower, +
$[call inherit-product, vendor/opengapps/build/opengapps-packages.mk]
8.