From 9c530b8affee6acfcac18f77160a8b53a451d988 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 16 Jan 2025 14:36:11 +0100 Subject: [PATCH] Set the default Android platform to 21 Also explain that the "zip" command is required to build AAR archives and that NDK_PLATFORM can be used to override the target platform. Fixes #1440 --- dist-build/android-aar.sh | 7 +++++++ dist-build/android-build.sh | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dist-build/android-aar.sh b/dist-build/android-aar.sh index 2aa10566f7..7f4df71d7f 100755 --- a/dist-build/android-aar.sh +++ b/dist-build/android-aar.sh @@ -9,6 +9,13 @@ SODIUM_VERSION="1.0.21.0" NDK_VERSION=$(grep "Pkg.Revision = " <"${ANDROID_NDK_HOME}/source.properties" | cut -f 2 -d '=' | cut -f 2 -d' ' | cut -f 1 -d'.') DEST_PATH=$(mktemp -d) +if which zip >/dev/null; then + echo "The 'zip' command is installed." +else + echo "The 'zip' command is not installed. Please install it before running this script." + exit 1 +fi + cd "$(dirname "$0")/../" || exit make_abi_json() { diff --git a/dist-build/android-build.sh b/dist-build/android-build.sh index 045590dd35..13c4638e0f 100755 --- a/dist-build/android-build.sh +++ b/dist-build/android-build.sh @@ -1,7 +1,8 @@ #! /bin/sh if [ -z "$NDK_PLATFORM" ]; then - export NDK_PLATFORM="android-19" + export NDK_PLATFORM="android-21" + echo "Compiling for default platform: [${NDK_PLATFORM}] - That can be changed by setting an NDK_PLATFORM environment variable." fi export NDK_PLATFORM_COMPAT="${NDK_PLATFORM_COMPAT:-${NDK_PLATFORM}}" export NDK_API_VERSION="$(echo "$NDK_PLATFORM" | sed 's/^android-//')"