'Android SDK on LINUX arm64 docker

I recently switched to a M1 MacBook Pro and I am struggling to understand how to re-build part of my dev environment: a Linux Docker image to build Android apps using fastlane.

If I run the amd64 image on Docker via rosetta emulation, it works but it is extremely slow (on the order of 6-10 times slower).

I researched a bit if it is possible to create an arm64 image and found few answers.

  • Here there is some research about it
  • Here there is an old docker image that is supposed to work

But nothing I have tried worked (even if I am able to build the images).

The main problem I have is that the entire Android SDK toolchain is only available for amd64 and even if Debian had at least one platform compiled for arm64, I need to have the last 6-7 platforms installed, so as soon as I add anything with sdkmanager, the new platforms tools installed contain binaries compiled for amd64 that obviously do not work.

Has anyone found a (not too nasty) hack to run the latest Android SDk platforms on arm64?

I am also willing to compile the entire toolchain from source, but I am am not sure which version of the tools for each platform should be built and how to configure the single platforms to use them.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source