Ubuntu – How to install the build dependencies for Android

10.1032-bitaptbuildpackage-management

I'm trying build the Android source using these packages. ButI am getting this error:

$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev
[sudo] password for asdf: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libc6-dev-i386
E: Unable to locate package lib32ncurses5-dev
E: Unable to locate package ia32-libs
E: Unable to locate package lib32readline5-dev
E: Unable to locate package lib32z-dev

I tried to download & install say libc6-dev-i386 debian package form here. But when I double click on the .deb file Ubuntu Software Manager says wrong architecture 'amd64'.

(My OS: 32-bit Ubuntu 10.10 (updated), Processor: AMD phenom II 64-bit.)

Best Answer

I believe that the android.com page is a little out of date. There are a lot of different workarounds that are floating around the net. I'll try to summarize what worked for me.

Two helpful, if imperfect, pages are located here:

crashcourse.ca
wildartist

First, it looks like you'll probably want to use java6 and not java5, judging by some of the group threads . So if you see java5 in instructions, know that you'll need to substitute in either the sun java6 or open java 6.

Here are the packages I needed for my 32-bit system:

sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk ant gcc-multilib g++-multilib

After those are in place, build repo :

sudo curl http://android.git.kernel.org/repo -o /usr/local/bin/repo   
sudo chmod a+x /usr/local/bin/repo

Then in your build directory:

repo init -u git://android.git.kernel.org/platform/manifest.git    
repo sync

The wildartist site continues:

If you encounter the message “command not found” then you can do it with the following commands:

$ sudo sh /usr/local/bin/repo init -u git://android.git.kernel.org/platform/manifest.git
$ sudo sh /usr/local/bin/repo sync

It will take much time to get the code even though the line is fast as the project itself is really huge. After the long waiting, you will find that the checkout process has been ended. The next thing to do is MAKE to build the project. But you will meet a message that the Java version is not correct and the build process fails. Then you can modify the build/core/main.mk file to change the text ”1.5″ to “1.6″.

At this point you should have the dependencies and the code take care of. You will still need to make .

Because the code base and supporting libraries and components are changing, it's hard to keep the instructions perfectly up-to-date, which is why there are so many conflicting how-to's for this process.

Related Question