Skip to content

Conversation

@nanangizz
Copy link
Member

Some commonly used third-party libraries (e.g: OpenSSL, OpenH264) require a minimum API level of 23, while the default API level may be too low (e.g: for NDK r27c, it is 21).

For example, when using NDK r27c, the configure script fails to detect OpenSSL and OpenH264. The config.log shows errors such as:

ld.lld: error: undefined symbol: stdin
ld.lld: error: undefined symbol: stderr

Some commonly used third-party libraries (e.g: OpenSSL, OpenH264) require a minimum API level of 23, while the default API level may be too low (e.g: for NDK r27c, it is 21).
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the configure-android script to enforce a minimum Android API level of 23, which is required by commonly used third-party libraries like OpenSSL and OpenH264. When using recent NDK versions (e.g., r27c), the default minimum platform level might be 21, which causes detection failures for these libraries.

  • Adds minimum API level enforcement to bump any detected API level below 23 up to 23
  • Updates help documentation to reflect this new minimum requirement
Comments suppressed due to low confidence (1)

configure-android:66

  • The minimum API level enforcement (lines 58-60) only applies when APP_PLATFORM is auto-detected. If a user explicitly sets APP_PLATFORM to a value less than 23 (e.g., APP_PLATFORM=android-21), the enforcement is bypassed, leading to the same OpenSSL/OpenH264 detection failures the PR aims to fix. The enforcement should be moved outside the if test \"x$APP_PLATFORM\" = \"x\" block to apply universally, after extracting the numeric value from user-provided values like "android-21".
if test "x$APP_PLATFORM" = "x"; then
  if test -d ${ANDROID_NDK_ROOT}/platforms; then
    APP_PLATFORM=`ls ${ANDROID_NDK_ROOT}/platforms/ | sed 's/android-//' | sort -gr | head -1`
  elif test -f ${ANDROID_NDK_ROOT}/meta/platforms.json; then
    if ! [ -x "$(command -v jq)" ]; then
      APP_PLATFORM=`cat ${ANDROID_NDK_ROOT}/meta/platforms.json  | grep -o '"min":[[:space:]]*[[:digit:]]*' | head -1 | grep -o '[[:digit:]]*' `
    else
      APP_PLATFORM=`cat ${ANDROID_NDK_ROOT}/meta/platforms.json  | jq -r ".min"`
    fi
  fi
  if test "x$APP_PLATFORM" != "x"; then
    if [ "$APP_PLATFORM" -lt "23" ]; then
      APP_PLATFORM="23"
    fi
    APP_PLATFORM="android-${APP_PLATFORM}"
  else
    APP_PLATFORM="latest"
  fi
  echo "$F: APP_PLATFORM not specified, using ${APP_PLATFORM}"
fi

@nanangizz nanangizz merged commit 8a17607 into master Nov 12, 2025
53 checks passed
@nanangizz nanangizz deleted the default-android-api-level branch November 12, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants