[HOW TO] Android Build Environment on Ubuntu 12.04
So my desktop system died after many years and I just finished building my new system. I stopped cooking ROMs some time ago and it was time to setup my Android build environment again. Last time I did that Google's directions were pretty much straight forward and did not run into any issues. Can't say that for this time, AOSP site needs to update their instructions a bit. I made notes during the process and thought to share them in case anyone finds themselves in a spot like me.
Use this guide as you follow the instructions at the AOSP website
and you should be fine. You can copy and paste all the terminal commands.
Initializing a Build Environment - Google's Instructions HERE
Python 2.6 -- 2.7 - Install dependencies before installing Python
sudo apt-get install build-essential
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Extract & Change Directory
tar -xvf Python-2.7.6.tgz
GNU Make 3.81 -- 3.82
Download GNU Make
Note: If following guide step by step then "cd .." with no quotes from Python-2.7.6 folder
Extract & Change Directory
tar -xvf make-3.82.tar.gz
You most likely can use apt-get install for the Python and GNU Make but I just prefer this way...
Oracle JDK 6
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
sudo update-java-alternatives -s java-6-oracle
sudo apt-get install oracle-java6-set-default
Note: Use arrow keys on keyboard to navigate confirmation dialogues. You can use OpenJDK with some tweaks but I prefer to use Oracle JDK 6
Installing required packages
sudo apt-get install git gnupg flex bison gperf build-essential
sudo apt-get install zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev
sudo apt-get install libx11-dev:i386 libreadline6-dev:i386
sudo apt-get install libgl1-mesa-dev g++-multilib mingw32 tofrodos
sudo apt-get install python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Bring up AOSP Guide HERE
Continue from Configuring USB Access
To create /etc/udev/rules.d/51-android.rules file type in terminal
sudo gedit /etc/udev/rules.d/51-android.rules
Make sure to follow AOSP instructions on changing "username" to your login name.
Keep following the guide till the end
Make sure to setup .ccache once repo sync (downloading of source) is complete.
When you are done, reboot system. Once booted click on Dash Home (First icon on side bar), if you notice there is nothing in Dash Home then do the following:
mv ~/.local/share/zeitgeist ~/.local/share/zeitgeist.bak
kill -s TERM `pidof /usr/lib/unity-lens-applications/unity-applications-daemon`
Your system is now ready to build AOSP.
Good luck and enjoy!
My new system specs are:
Asus Z87-A Motherboard
Crucial Ballistix Sport VLP 16GB DDR3-1600
WD Black 1TB
Samsung 840EVO RAID0 - Ubuntu use only
Corsair Hydro Series H80i
Corsair 300R Case
Corsair CX Series CX750M 750 Watt
Build Time ~38 minutes from fresh source download. Have not tried with ccache functioning yet.
If you would like to make a small donation for my work you may do so by clicking HERE
You may also Tweet
me a Starbucks
Trenta Iced Black Tea 4 pump classic which is my go go juice that keeps me going @androiduser0001 by clicking HERE