Skip to main content

Building Android 10

This article introduces how to compile the Android system, including compilation and packaging of U-Boot, kernel, and AOSP.

Environment Setup

System Requirements


apt-get update -y && apt-get install -y openjdk-8-jdk python git-core gnupg flex bison gperf build-essential \
zip curl liblz4-tool zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip mtools u-boot-tools \
htop iotop sysstat iftop pigz bc device-tree-compiler lunzip \
dosfstools vim-common parted udev libssl-dev python3 python-pip lzop swig

Downloading Repo

Repo is a tool used in Android development for managing multiple Git repositories. It's a Python script that helps developers with version control and management of multiple Git repositories. You can download Repo using the following commands:


wget https://storage.googleapis.com/git-repo-downloads/repo -P ~/bin/
or
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

Downloading Source Code


  $ repo init -u https://github.com/radxa/manifests.git -b rockpi4-android-10 -m rockchip-q-release.xml 
  $ repo sync -d --no-tags -j4
  

Building the Image

There are two methods to build the image:

Using the SDK build script for compilation:


  $ source build/envsetup.sh
  $ lunch rk3399_Android10-userdebug
  $ ./build.sh -UACKu
  

After the compilation is complete, you can find the image in the IMAGE directory.

Method 2

You can follow these steps to build the image:

  • Set up the build environment

  $ source build/envsetup.sh
  $ lunch rk3399_Android10-userdebug
  
  • Compile U-Boot
$ ./build.sh -U
  • Compile the kernel
$ ./build.sh -CK
  • Compile AOSP
$ ./build.sh -A
  • Generate Images
$ ./build.sh -u

Common Issues

  • For Android 11, it's recommended to compile in an Ubuntu 16.04 environment as other Ubuntu versions may cause compilation errors.

    You need to be logged into GitHub to post a comment. If you are already logged in, please ignore this message.

    Radxa-docs © 2026 by Radxa Computer (Shenzhen) Co.,Ltd. is licensed under CC BY 4.0