Affichage des articles dont le libellé est environment. Afficher tous les articles
Affichage des articles dont le libellé est environment. Afficher tous les articles

mercredi 29 janvier 2014

[HOW TO] Android Build Environment on Ubuntu 12.04 topic




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

Python 2.6 -- 2.7 - Install dependencies before installing Python

Code:


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


Download Python

Code:


cd ~/Downloads/
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz


Extract & Change Directory

Code:


tar -xvf Python-2.7.6.tgz
cd Python-2.7.6


Install

Code:


./configure
make
sudo make install


GNU Make 3.81 -- 3.82

Download GNU Make

Code:


cd ~/Downloads/
wget http://ftp.gnu.org/gnu/make/make-3.82.tar.gz


Note: If following guide step by step then "cd .." with no quotes from Python-2.7.6 folder

Extract & Change Directory

Code:


tar -xvf make-3.82.tar.gz
cd make-3.82


Install

Code:


./configure
make
sudo make install


You most likely can use apt-get install for the Python and GNU Make but I just prefer this way...

Oracle JDK 6


Code:


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

Git
sudo apt-get install git

Installing required packages


Code:


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 libgl1-mesa-glx:i386


If you receive:


Code:


The following packages have unmet dependencies:
 libgl1-mesa-glx:i386 : Depends: libglapi-mesa:i386 (= 8.0.4-0ubuntu0.7)
                        Recommends: libgl1-mesa-dri:i386 (>= 7.2)
E: Unable to correct problems, you have held broken packages.


Then


Code:


sudo apt-get install libglapi-mesa

And


Code:


sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386

Note: libgl1-mesa-glx:i386 might be causing the issue so you might be able to omit that in the corresponding sudo apt-get install line so you will not need to do the IF/THEN/AND and then the GUI fix down the road. I did not omit and fixed what it broke after reboot. Instructions are provided below to fix what may break.

Continue


Code:


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


Reboot system here.

If you boot to blank screen with just flashing cursor then:
reboot
CTRL+ALT+F1 as system reboots to enter command line. Type following command:


Code:


sudo apt-get install ubuntu-desktop xorg

Reboot when complete. We are not done yet so keep following guide.

Bring up AOSP Guide HERE

Continue from Configuring USB Access
To create /etc/udev/rules.d/51-android.rules file type in terminal


Code:


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:


Code:


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!