tags:

views:

136

answers:

1

Hi,

I am attempting to build Google's Android v2.2 (Froyo) from source on an Asus A3E laptop (512MB ram) running Ubuntu Netbook 10.04.

I have followed the instructions on http://source.android.com/source/download.html and set java to version 5 with using:

sudo update-java-alternatives -s java-1.5.0-sun
java -version gives me: 1.5.0_018 

Thus allowing Android's prebuild check to work. I have also set my ~/.bashrc to export the java home directory and set it to the android java home. I have also:

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

Then I just simply:

make

This goes for about a minute then I get a long pause at:

target Dex: core

Then:

make: *** [out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.dex] Killed

and I'm back to a prompt. I suspect that it's a memory issue as it crashes any browser instances that I have open at the same time. Does anyone know a solution/workaround or at least a good path to start debugging.

Cheers, Stu

+1  A: 

If the system is killing browser windows you're probably running out of memory. /var/log/messages or the output of "dmesg" may have some info.

512MB of RAM is not enough for "dx" to process core.jar (or its big brother framework.jar). You may need to add additional swap space. Check "swapon -s" to see what sort of swap is currently configured. You can use mkswap and swapon to create a swap area and start using it. You will need a gigabyte or two. (If you look in build/core/definitions.mk, you can see dx being passed -JXmx1536M, i.e. the Java VM is given a 1.5GB heap.)

Adding swap should get you through the build, eventually. It will be painfully slow if you're swapping constantly. You'd be better off adding more physical RAM to the laptop.

fadden
dmesg showed the lack of swapspace and the 256MB of swap wasn't enough. Thanks for the tips on what I'll need to update, I'll increase the swapspace as I shouldn't need to be doing this for too long :) Cheers, Stu
Stu