I created clean user to compile Android.
Workaround for Python 2. When you start repo on recent Gentoo (which uses Python 3), next error will rise:
# repo File "/usr/bin/repo", line 180 except OSError, e: SyntaxError: invalid syntax
What I done to fix this (emerge Python 2, create symbolic link to it under user account):
# emerge -av python:2.7 $ mkdir ~/bin $ export PATH="~/bin:$PATH" $ cd ~/bin $ ln -s /usr/bin/python2 ~/bin/python
Emerge Sun JDK to compile Android (1.6 version needed) and set it as user java-vm:
# emerge -av sun-jdk $ eselect java-vm list
Find sun-jdk and run next command with corresponding number.
$ eselect java-vm set user 2
Install x86 (32 bit) libs for Android to build.
# emerge -v emul-linux-x86-baselibs
For me there are errors corresponding to Nullable class in sdk/chimpchat project. To fix this I compiled host jsr305 library which contains refence to @Nullable and added it to project manually.
# emerge -v jsr305 $ croot $ nano sdk/chimpchat/src/Android.mk
Now add jsr305 to local java libraries. Then link it to system one (for me ./external/jsr305/ dont compile host library).
$ ln -s /usr/share/jsr305/lib/jsr305.jar /home/john/android/ics/out/host/linux-x86/framework/jsr305.jar