Android SDK on Docker for ARM64 (Raspberry Pi 4) for building APK Android SDK on Docker for ARM64 (Raspberry Pi 4) for building APK docker docker

Android SDK on Docker for ARM64 (Raspberry Pi 4) for building APK


Although the question is inactive for month, I should record my effort for the later. Since sdkmanager using progress bar like output, some messages are override which cause the key problem is hard to find: there is a key dependent emulator is failed to install. I think it is because there is no matched version of qemu. But actually we do not need the emulator during compile time. So my simple solution is:

  1. Install the Android command line tool on a x86 based linux
  2. Install platform-tools, build-tools
  3. tarball the emulator directory in $ANDROID_SDK_ROOT
  4. Install Android command line tool on Raspberry Pi
  5. Install platform-tools which create basic directory structure
  6. Extract emulator from the tarball into $ANDROID_SDK_ROOT
  7. GOOD LUCK

It seems some tools cannot run under 32-bit system, so one cannot use their favorite Raspberry Pi OS which is 32-bit only. Use Ubuntu 64-bit instead.

Unfortunately after another hours research, the solution cannot work besides one can install build-tools. You cannot compile Android application on AArch64(or arm64) just because all toolchain download from official repository are built for x86. If one want to build Android application on AArch64 CPU such as Raspberry PI, they need to build the whole toolchain on that arch.