Upon attempting to run an Android project that works on Apple arm64 on Linux arm64 I got the following issue:
[CXX1429] error when building with ndkBuild using app/src/main/jni/Android.mk: ERROR: Unknown host CPU architecture: aarch64
ndkVersion: "25.2.9519653"
I tried modifying /sdk/ndk/25.2.9519653/ndk-build
from
#!/bin/sh DIR="$(cd "$(dirname "$0")" && pwd)" $DIR/build/ndk-build "$@"
to
#!/bin/sh DIR="$(cd "$(dirname "$0")" && pwd)" arch -arm64 /bin/bash $DIR/build/ndk-build "$@"
but it could not recognize the parameter
The solution was to modify ndk_bin_common.sh:
sed -i 's/arm64)/arm64|aarch64)/' "${ANDROID_NDK_HOME}/build/tools/ndk_bin_common.sh"
original solution