Android Kitkat 4.4.4 Compile on Ubuntu 14.04

Short manual how to prepare Linux Ubuntu 14.04 environment to be able to compile Android Kitkat 4.4.4

Assumption:

The tutorial is dedicated to Linux users

As an example The BeagleBoneBlack Android build instruction taken from

https://github.com/csimmonds/android4beagle

Host Machine Hardware Configuration

100GByte free diskspace

8 or better 16 GByte of Ram

At least 4 thread CPU (performance reason)

1. Create directory for Android build purpose

mkdir a4b_4.4.4

2. Go to created folder

cd a4b_4.4.4

3. Java preparation

download java from

https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html

When download complete perform a following steps

chmod +x jdk-6u45-linux-x64.bin

./jdk-6u45-linux-x64.bin

sudo mkdir /usr/lib/jvm

sudo mv jdk1.6.0_45 /usr/lib/jvm/

sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1

sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws

ls -la /etc/alternatives/java*

Note: Due to some problems with ‘jar’ during compilation it is necessary to update the PATH by

sudo gedit /etc/environment

and append at the end of path the path to java directly

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jdk1.6.0_45/bin"

Reboot system afert above and finnaly check which version is active

java -version  

should be

java version “1.6.0_45”
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

4. Download necessary Ubuntu packages

sudo apt-get install gperf git repo bison u-boot-tools

5. Get the source code

repo init -u https://github.com/csimmonds/android4beagle -b android-4.4.4_r2
repo sync -c

6. Initialize environment

source build/envsetup.sh

7. Choose target

lunch

and select 9 or 10 option

8. Start compilation

./build-beagleboneblack.sh

Note: When first time run it is necessary to copy latest repo and assign name, email for git

Lucjan Bryndza

Embedded software engineer