Android-Generic Project : Getting started
Last updated
Was this helpful?
Last updated
Was this helpful?
On this page:
You will need to have synced AOSP or a ROM source for Android 10,11,12 prior to adding this to your build environment.
For PC builds - Android 10, 11 & 12 (so far):
For Waydroid builds (Android 10 only):
What you need to build with
System Requirements
Installing Java 8
Grabbing Dependencies
If you plan on building the kernel with the NO_KERNEL_CROSS_COMPILE flag, you will need to also have gcc-10+ installed:
(PLEASE NOTE: The source for AG v2023 has been pushed but the documentation for it has not. This documentation is only applicable to the archived version of the project.)
Including AGP into your AOSP based project is as simple as cloning it into a vendor folder.
Once the project is cloned, all you have to do is a couple small commands to get things going.
For the legacy menu (SSH/TTY only)
That's it! It will initially generate the menu items with what is available for modules on initial launch
For the legacy menu (SSH/TTY only)
That's it! It will initially generate the menu items with what is available for modules on initial launch
Now we can go step-by-step through the next few steps and learn how to operate AGP
Generate Manifest ( v2.x GUI/Legacy)
**After the above steps are all complete, we are ready to sync the new manifest files that are found in your projects .repo/local_manifests folder. To do that, we added **
Sync Project\
This option is the equivalent of running "repo sync -q --force-sync --optimized-fetch --no-tags --no-clone-bundle --prune -j8" and will run in the terminal window.
At this point, you may see "fatal: remove-project element specifies non-existent project: ........." This means that your project has removed an item from manifest a different way than we were expecting from the scripts. Solution: cd into .repo/local_manifests/01-remove.xml and comment out the line the sync script was complaining about If any other errors show up with sync, try to manually run:
Once the project has completed successfully, we can continue onto the next step\
If your project is close to AOSP, then this step should be 100% automatic and no "Conflicts" will show up. Otherwise, there is a chance things will start to require some actual work here. If you do happen to get any patches that show as "Conflicts" here, follow these instructions:\
Apply Kernel Patches
Build Options
This will launch the main build menu, which contains all the options related to the build commands.
This menu will show the various build options for compiling your project through AG.
Select Apps Type
FOSS - Free & Open Source apps from Aurora Droid & Aurora Store (and microG client) (x86/x86_64/arm64) GMS - not implemented by default EMU-Gapps - Proprietary gapps extracted from Google's Emulator images. (x86_64 only) Vanilla - No added apps or services\
Select Native-Bridge Type
None - No changes to Native Bridge aside from what Android-x86 includes by default Intel's Houdini - Will pull the latest supported ChromeOS recovery image, and extract the Houdini & Widevine files from that and include in your build. Google's libndk-translation - Will need manual setup of vendor/google/emu-x86 before using. Follow readme from that project (we were unable to reproduce results of extracting super.img automatically)\
Select Make Type
Standard .iso Image - generic .iso for MBR/EFI EFI .img file - Builds .iso for using in EFI devices RPM Linux Installer - Compiles as an .rpm installer for linux based systems and will install in a folder on the linux drive. \
Select Extra Options
This will contain only options that can be interchangeable (affected with only an export or build environment variable)
Make Clean Before Build - Will add "make clean" to your build command and have it run every time you start the build. No Kernel Cross-Compile - Will add the override for NO_KERNEL_CROSS_COMPILE and allow you to build the kernel using GCC 10/11 from your installed system instead of using AOSP or your ROM's GCC\
Run Make Clean
Selecting this will immediately run the "make clean" command on your project. Clearing the PRODUCT_OUT folder\
Enable Rusty-Magisk
Based on what Product you selected prior to selecting this option, the script will compile the resources needed to include Rusty-Magisk into your build\
Start The Build
This command is dependent on all previous options and will also save/reload your last used build command (all the options selected in this section above), then run the build command in the terminal. From this point forward, any errors will need to be resolved manually.
Resolving Patch Conflicts
Some of the patches have duplicates for different vendor setups. So you will sometimes get results that look like this:
Notice how the one starting with "0015-Bliss-" failed, but the patch starting with "0015-Tesla-" applied correctly? If that happend on your vendor setup, you can ignore that patch. But if you only see one patch that had a "Conflicts", that will need to be applied and fixed.
First, you apply the patch manually:
You can expect that to fail, but it's crutial to the next step. Next you patch the file again, but using the "patch" command
This will generate the .orig & .rej files to help narrow down what you need to fix. Once the conflicting parts (what's in the .rej files) are resolved, delete the .rej & .orig files, then stage the files:
Then we can continue the staged git am commit from the first step:
After applying the patch(s) to your local project folder, remember to generate the patch needed to resolve that conflict:
Then copy the patch to the appropriate vendor folder for the conflict. Any patches that are needed to be done to the ROM before applying the generic set of patches will go to the prepatch folder (pc_vendor_prepatches/treble_vendor_prepatches), while any conflicts that happened from the generic patches themselves should go to the vendor_patches folder (pv_vendor_patches/treble_vendor_patches) Example:
(Bliss/Lineage/Others) Apply Extras Patches
Selecting this will apply any patches that have been added to vendor/ag/utils/android_r/google_diff/x86-extras/ These have a number of patches for Bliss and LineageOS based projects.\
(Bliss/Others) Apply Prepatches
This will apply any of the pre-patches added to vendor/ag/utils/android_r/google_diff/x86-prepatch/ (Mostly only needed for Bliss so far)
There are various tools we added to help add/maintain/troubleshoot. Those are all listed below
Add Boringdroid This will clone in all the repos required to add Boringdroid System UI to your build, and automatically patch frameworks/base with the required additions\
Add Gearlock This will clone in Gearlock and will automatically launch it's scripts when you start your build command \
Generate Permissions This tool is meant to help figure out the various permissions that .apk's ask for, and will generate a private permissions .xml for any single (or batch folder of) apk files. will ask you to select a folder of prebuilt .apk files, and then select a permissions folder/filename to contain the resulting permissions.xml \
Grab Modules When updating/adding on new scripts to use with AGP, this will reload the modules list and relaunch the menu (mostly redundant now as the menu reloads the list automatically)\
Manifest Backup This will take all the repos currently included in your project and generate a manifest.xml with revisions included in order to easily share your project with others.
This project supports an array of proprietary and enterprise functions that will be included in vendor/ag/private-scripts/ which is only accessible through licensed access to our private AGP repos. In the Public repo for AGP, you will see a placeholder script that does nothing:
license-to-access-enterprise-tools
Add Proprietary Files - Will let you include proprietary vendor files or prebuilts to be included in your build
Add Proprietary Native-Bridge - Will allow you to include a vendor licensed native-bridge, like Intel's Houdini
Add Proprietary Recovery - Will add your customized recovery image (Recovery development contract required)
And more...
Please make sure you're well versed in building AOSP: before proceeding.
This step will generate the initial manifest files for Android-x86 or Waydroid based builds. In some cases, this step may fail and state that things did not generate properly. Please read the feedback as it is usually a missing dependency. \
Apply Base Patches
This will launch the Kernel Patching menu where you will need to select what target kernel you synced in order to apply the proper patches to it. This only applies to Upstream Linux/Google kernel branches that don't have our patches pre-applied.
****
Select Product Type Selecting this will ask you what device type you plan on targeting (PC: android_x86 / android_x86_64)
Select Variant Type
Selecting this will ask you what build variant type you plan on targeting (user, userdebug, eng)
****
Selecting this will present the options for included Apps type
****
Selecting this will present the options for Native-Bridge.
****
Selecting this option will allow you to choose what kind of final image you would like.
****
First off, we include two redundant methods for applying patches beyond the base patches script. Apply Base Patches with Resolutions: This will search through each set in vendor/ag/utils/android_r/google_diff/x86-resolutions/set# and attempt to apply any resolutions found after one of the base patches has a conflict. Apply Base Patches Verbose: This will run through the base set of patches, and offer a more verbose patching method. This script will leave a lot to manual work. Manual Patch Resolution: You will want to then make a copy of all the results of the patch scripts (Copy and paste the contents of the terminal output into a Notepad or text document). Each of the patches applied either resulted in "Applying", "Already applied", or "Conflicts". The only ones we want to pay attention to here are the "Conflicts", but only half of them.
Add AG Prebuilt Apps This will clone the AGP Prebuilts repo into your project and link to your build. This includes: Set Orientation - A manual screen rotation control for Android Taskbar - The featured "Desktop Mode" for Bliss OS created by @farmerbb Taskbar Support Library - A secondary app for Taskbar that contains permissions and defaults for how Taskbar runs on Bliss OS Smart Dock - The featured "Desktop Mode" for Bliss OS created by @axel358 Google Webview - A version we have confirmed working on our PC builds (Many ROM's include a version of Webview that does not play nice with PC builds) (FOSS ONLY) - AuroraServices - a secondary app for Aurora Store/Droid that allows a more seamless install experience. Wallpaper Overlays - Will also include any wallpapers added to the drawable folders in vendor/prebuilts/agp-apps/overlay/frameworks/base/core/res/res/\
If you do have access to the AGP private repos, all the scripts included in your license will show up at the bottom of the main menu. For example, in the screen below, we have three scripts: