Treating A20 boards like outdated piece of HW by vendors makes building Android for Cubietruck not trivial task. Finding documentation, mailing list or blog post that clearly describe steps is almost impossible. Most of links to SDK are broken and instructions outdated. Because of that I decided to leave couple notes for me and all of you lost in this madness.

Hopefully below steps can build foundation for future development and improvements.

Get the code

It took me couple of googling hours to realize that key was to carefully search cubietech sever. Finally I found this.

So I cloned repos with code:

Based on other instruction that I hit previously (but download link was broken) I run build process:

Lichee compilation error

World would be too beautiful if everything would work right out of the box, so I hit this very informative build error:

After some digging I managed to narrow down issue to piece of smart code, that injected version string through define, which generated above mess. Without thinking much about fix I just changed incorrectly generated define to driver version string. This string will be presented in UMP modinfo. Patch which fix above looks like that:

After above change repeated build command finish without errors.

Android

I assume you directory layout looks like this:

Go to Android directory and source environment setup script. Android do not like shells other then bash, so change you shell if you using something different:

You will get menu which will look like this:

Of course our target is sugar_cubietruck-eng, so type 16. Then copy kernel and modules using extract-bsp function and start build:

Wrong make version

Android expects make in version 3.81 or 3.82 and recent distros (like my Debian stretch/sid) have make>=4.0. Problem signature looks like this:

You can workaround this problem using below patch:

Java SE 1.6 required

If your distro is not prepared you can hit something like this:

To fix this issues add this repo to your /etc/apt/sources.list

Then update and install required Java SDK.

You also may need to update alternatives if Java SE 1.6 was installed previously:

Missing dependencies

If you will hit some weird compiler errors like this:

This mean that you have missing dependencies. On Debian you can fix this with:

After all above fixes running make again should build the image:

It took some time, so you can go for coffee. Final messaged for passed build should look like this:

Pack image

In output it will tell you where your image is:

Image installation

Image can be installed using LiveSuit. Flashing instructions can be found on sunxi wiki.

Summary

ct-android-1

As you can see Android boots to initial screen and it looks like we have working prcedure for building Cubietech Android SDK. This gives good ground for future experimentation.

Hopefully above instructions works for you and will not outdate soon. If you found any problems/errors please let me know in comment. I you think content can be useful to others please share.

Thanks for reading.