ANDROID_SDK Compilation
SDK Introduction
SDK (Software Development Kit) is a collection of development tools provided for a specific software framework, hardware platform, or operating system, designed to help developers create applications more efficiently.
Compilation Environment Configuration
Install Ubuntu on a PC to perform SDK compilation.
- Hardware: PC must meet RAM ≥ 16 GB, CPU cores ≥ 4, Hard Drive ≥ 500GB.
- Software: Ubuntu, allocate ≥ 200GB disk space for virtual machines.
Install dependencies.
sudo apt-get update
sudo apt install autoconf bc binfmt-support bison build-essential bzip2
sudo apt install chrpath cmake cpp-aarch64-linux-gnu curl device-tree-compiler diffstat
sudo apt install expat expect expect-dev fakeroot flex
sudo apt install g++ g++-multilib gawk gcc gcc-multilib git gnupg gperf gpgv2 imagemagick
sudo apt install lib32ncurses5-dev lib32readline-dev lib32z1-dev libgmp-dev
sudo apt install libgucharmap-2-90-dev liblz4-tool libmpc-dev
sudo apt install libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev
sudo apt install libxml2 libxml2-utils live-build lzop
sudo apt install make module-assistant ncurses-dev openjdk-8-jdk
sudo apt install patchelf pngcrush python2 python3 python-is-python3 python-pip
sudo apt install qemu-user-static rsync schedtool squashfs-tools ssh sudo
sudo apt install texinfo u-boot-tools unzip
sudo apt install xsltproc yasm zip zlib1g-dev pip
sudo pip install pyelftools
sudo ln -s /usr/bin/python2 /usr/bin/python
Obtaining SDK Source Code
Note
1. The SDK cannot be compiled in a shared directory.
2. The compilation host cannot log in using the ROOT account.
1. Click to download Android SDK source code, Click to download release_sdk.sh script. Typically, download the file with the latest date suffix.
2. Place the tar.gz, md5sum, and release_sdk.sh files in the same directory on the compilation host.
3. Run the script to restore the SDK source code.

Full Compilation
1. Navigate to the code path on the compilation host and execute the following command to configure the compilation target.
Select based on the corresponding main SoC and configuration file.
| Board | SoC | Configuration File |
|---|---|---|
| K10B | a733 | BoardConfig-a733-kickpi-k10b.mk |
Example of configuring the environment for K10B:
$ ./build.sh lunch
====== Build Configuration ======
1\. BoardConfig-a733-kickpi-k10b.mk
Select a board configuration (1-1): 1
Selected Board Configuration: longan/device/config/chips/a733/BoardConfig-a733-kickpi-k10b.mk
2. Compile the standard full image.
Individual Compilation
- Compile Multi-screen Recognition Image
Tip
If you need a set of firmware to automatically adapt to different displays when compiling the SDK, please perform this operation. In this image, MIPI screen serves as the primary display, HDMI as secondary.
- Compile Uboot Individually
- Compile Android Individually
- Compile Kernel Individually
- Configure Kernel defconfig
Q&A
- Android compilation error due to path errors caused by code location changes
Clear the data first, then recompile.
source build/envsetup.sh
source longan/device/.BoardConfig.mk
lunch $KICKPI_TARGET_PRODUCT-$KICKPI_BUILD_VARIANT
make clean -j32
- Insufficient Compilation Space
Compile by reducing the number of threads.