SDK 8.1.0r53 (GNU/Linux, Windows)

Recreate matching build environment

The current reference build environment for this version is Ubuntu 14.04.

Build dependencies

# https://source.android.com/setup/build/initializing
dpkg --add-architecture i386
apt-get update

apt-get -y install wget
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u45-b14-1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u45-b14-1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u45-b14-1_amd64.deb
checksumfile=$(mktemp)
cat <<'EOF' > $checksumfile
0f5aba8db39088283b51e00054813063173a4d8809f70033976f83e214ab56c0  openjdk-8-jre-headless_8u45-b14-1_amd64.deb
SHA256 9ef76c4562d39432b69baf6c18f199707c5c56a5b4566847df908b7d74e15849  openjdk-8-jre_8u45-b14-1_amd64.deb
SHA256 6e47215cf6205aa829e6a0a64985075bd29d1f428a4006a80c9db371c2fc3c4c  openjdk-8-jdk_8u45-b14-1_amd64.deb
EOF
sha256sum $checksumfile || exit "Incorrect checksums"
dpkg -i openjdk-8-jdk_8u45-b14-1_amd64.deb \
  openjdk-8-jre-headless_8u45-b14-1_amd64.deb \
  openjdk-8-jre_8u45-b14-1_amd64.deb || true
apt-get -y -f install

apt-get -y 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

# TODO: are hose still necessary?
apt-get -y install python-networkx
apt-get -y install zlib1g-dev:i386

# Windows dependencies
# https://sites.google.com/a/android.com/tools/build  2015-07-23
apt-get -y install mingw32 tofrodos

Prepare source tree

Install repo:

sudo apt-get install curl ca-certificates git python
mkdir ~/bin/
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

# avoid prompts
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git config --global color.ui true

Checkout the source:

mkdir ~/wd/
cd ~/wd/
~/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-8.1.0_r53
time ~/bin/repo sync --current-branch -j4

Build the SDK

export BUILD_NUMBER="user.8.1.0_r53"
. build/envsetup.sh
lunch sdk-user
time make sdk -j$(nproc) showcommands dist

time make win_sdk -j$(nproc) showcommands dist

Results:

-rw-r--r-- 1 android android 629M Dec  8 03:33 out/dist/android-sdk_user.8.1.0_r53_linux-x86.zip
-rw-r--r-- 1 android android 631M Dec  8 04:18 out/dist/android-sdk_user.8.1.0_r53_windows.zip
-rw-r--r-- 1 android android 629M Dec  8 03:33 out/host/linux-x86/sdk/sdk/android-sdk_user.8.1.0_r53_linux-x86.zip
-rw-r--r-- 1 android android 631M Dec  8 04:18 out/host/windows/sdk/sdk/android-sdk_user.8.1.0_r53_windows.zip

TODO

Rebuild the prebuilts/ sub-directories.

Error messages and resolutions

-

Notes

Build result recap

$ tools/bin/sdkmanager --list
 Installed packages:
  Path                                         | Version | Description                    | Location                                
  -------                                      | ------- | -------                        | -------                                 
  build-tools;27.0.1                           | 27.0.1  | Android SDK Build-Tools 27.0.1 | build-tools/android-8.1.0/              
  docs                                         | 1       | Documentation for Android SDK  | docs/                                   
  platform-tools                               | 27.0.0  | Android SDK Platform-Tools 27  | platform-tools/                         
  platforms;android-27                         | 1       | Android SDK Platform 27        | platforms/android-8.1.0/                
  system-images;android-27;default;armeabi-v7a | 1       | ARM EABI v7a System Image      | system-images/android-8.1.0/armeabi-v7a/

Available Updates:
  ID                   | Installed | Available
  -------              | -------   | -------  
  platforms;android-27 | 1         | 3        

ccache usage

N/A

build stats

Using i5-6300HQ (4x2.30GHz), SSD disk:

  • make sdk: build completed successfully (02:55:36 (hh:mm:ss))
  • make win_sdk: build completed successfully (44:30 (mm:ss))
  • du -sh wd/: 162G
  • du -sh wd/.repo/: 31G

Automated build recipe

https://gitlab.com/android-rebuilds/auto/tree/master/sdk-8.1.0