The hardware configuration

I59400f (fully adequate is slow)

32G (16G is enough for visual inspection)

1T M.2 (Decisive Solid state)

Software environment

MacOS Catalina 15.4 (Host OS)

Parallels 15.1 (VIRTUAL Machine)

Download address: oneself look for version on the net, have copyright problem, inconvenient to reveal

Ubuntu Desktop 20.04 (Vm Operating System)

Download: ubuntu.com/download/de…

Note: VM Settings: CPU6 core, 16 GB memory, and 256 GB hard disk

The official documentation

Build environment setup and REPO download setup, please refer to the official documentation, this article mainly addresses some possible problems

source.android.com/setup

Ubuntu Desktop 20.04 build environment, according to the official Ubuntu 14.04 build document can be, the only difference is to change apt-get to apt

I’ll list them here.

Install related libraries

sudo apt install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip
Copy the code

Please install this library in advance, Ubuntu 20 does not exist, it should be due to 64-bit operating system

sudo apt-get install libncurses5
Copy the code

Repo Installation precautions

There are two versions of REPO available for download, one python2 and one python3, and be careful to choose the one that fits your current environment

Source code version

Note: Do not compile the master branch; there may be compilation errors in the code

The branch for this compilation is Android-10.0.0_r33

Initialization command

Repo init -u https://android.googlesource.com/platform/manifest - b android - 10.0.0 _r33 repo syncCopy the code


error while loading shared libraries: libncurses.so.5

sudo apt-get install libncurses5
Copy the code

Solution from: stackoverflow.com/questions/1…


FAILED: out/target/product/generic_x86/system-qemu.img

FAILED: out/target/product/generic_x86/system-qemu.img
/bin/bash -c "(export SGDISK=out/host/linux-x86/bin/sgdisk SIMG2IMG=out/host/linux-x86/bin/simg2img; device/generic/goldfish/tools/mk_combined_img.py -i out/target/product/generic_x86/system-qemu-config.txt -o out/target/product/generic_x86/system-qemu.img)"
  File "device/generic/goldfish/tools/mk_combined_img.py", line 48
    print "'%s' cannot be converted to int" % (line[2])
          ^
SyntaxError: invalid syntax
14:03:41 ninja failed with: exit status 1

#### failed to build some targets (02:05:48 (hh:mm:ss)) ####
Copy the code

This problem is caused by my default setting python to point to PYTHon3, which causes errors when running Python code. The solution is to redirect the connection in /usr/bin/python to python2 and compile again


Here’s what happened when I compiled the master branch

fatal error: linux/netfilter/xt_DSCP.h: No such file or directory

// Create a file connectioncd external/iptables/extensions/include/linux/netfilter
ln -sXt_dscp. h xt_dscp.h xt_dscp.h AOSP/external/iptables/include/Linux/netfilter_ipv4 / ipt_ECN h modified method: Xt_dscp. h> include < Linux /netfilter/xt_dscp.h>Copy the code

Solutions from: groups.google.com/forum/#! Top…