Android NDK is updated from legacy ndk-bundle stuck at unsupported
r22b to LTS NDK r23c (23.2.8568313).
Since GNU binutils have been removed from NDK since r23 (see
https://github.com/android/ndk/wiki/Changelog-r23), ndk-make.sh now
uses TARGET_AR=llvm-ar and uses a workaround for `-lgcc` requirement.
Android command line tools used in the Dockerfile are updated to build
8512546
Preview APKs now use NDK r23c too.
Debug builds of the core (like `ndk-make.sh arm64-v8a`) take about a minute, while
a release bulid (`ndk-make.sh`) takes about 15 minutes.
But as most people seem not to use debug builds regularly because
they are tricky to use, here comes an improvement :) If you gave the wrong argument to `ndk-make.sh`, a warning dialog will now pop up inside the app, telling you what you did wrong and what you should do instead.
`ndk-make.sh` writes its argument into the file `ndkArch`.
`getNdkArch()` in `build.gradle` then reads this file and its content is assigned to
`BuildConfig.NDK_ARCH`. `checkNdkArchitecture()` then checks this.
Sorry for the click-bait title, but it fitted too well ;-)
Anyway, I added the possibility to ndk-make.sh to compile only for one
arch.
In my tests, if I also set the optimisation level to 0 (default is 3),
the compilation time went down from 3:30 to 1:20. Not sure if this is
worth it because I remember a comment stating that this makes generating
keys take forever. Maybe I should do some measurements and experiment
with levels 1 and 2 but that's for another PR.
What do you think?