Pages

Get it free, Try now

Free Cell Phones

Friday, August 13, 2010

Android build errors fix under Ubuntu 10.04

I'm not going to tale down on how to download and set up android, this article is mainly intended to fix Android build errors while compiling on Ubuntu 10.4

Below are the issue which I personally encountered while building Android sources.

1. bison not found

Install only bison via synaptic package manager

2.  Java version miss match
sudo apt-get remove sun-java6-jre sun-java6-jdk sun-java6-plugin

or
sudo apt-get autoremove sun-java6-jre sun-java6-jdk sun-java6-plugin


To Install java5
sudo apt-get install sun-java5-jre sun-java5-jdk sun-java5-plugin

To check which version of java is enabled
java -version

To change manually the java version



sudo update-alternatives --config java




then choose accordiingly

3. Error: zlib.h no such file or directory
error while compiling android sources with zlib.h not found

cgi.c:22:18: error: zlib.h: No such file or directory
Try this to get zlib.hGenerated: (out/target/product/generic/android-info.txt)
Target system fs image: out/target/product/generic/obj/PACKAGING/systemimage_unopt_intermediates/system.img
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Installed file list: out/target/product/generic/installed-files.txt

$ sudo apt-get install zlib1g-dev

After that, you might need libncurse

$ sudo apt-get install libncurses5-dev

4: Flex command not found
Flex not found
Try installing flex through synaptic manager
or

sudo apt-get install flex

5. X11/Xlib.h: No such file or directory

Try installing libx11-dev from synaptic package manager

6. sh: gperf: not found

Try installing gperf from synaptic package manager

Finally, generated output files after successul Froyo Build

Generated: (out/target/product/generic/android-info.txt)
Target system fs image: out/target/product/generic/obj/PACKAGING/systemimage_unopt_intermediates/system.img
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Installed file list: out/target/product/generic/installed-files.txt

Now how to Install self built Android images on Emulator


4. Backup the folder <android_sdk_folder>/platforms/android-8/images (android_sdk_folder is the Android SDK installation folder)

5. Replace the files ramdisk.img, system.img and userdata.img in <android_sdk_folder>/platforms/android-8/images with the files built from above steps.

6. Start the emulator and wait.

That’s it Now Enjoy Phone Emulator with Froyo update.

1 comment:

  1. This article will be updated as and when new Build errors are fixed

    ReplyDelete