Before running your build command, set the following environment variables:
export ANDROID_HOME=/path/to/android-sdk
export ANDROID_SDK_ROOT=/path/to/android-sdk
export ANDROID_NDK_HOME=/path/to/android-ndk
export NDK_ROOT=/path/to/android-ndk
Make sure to replace /path/to/android-sdk and /path/to/android-ndk with the actual locations of your SDK and NDK.