-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
Problem
The Swift SDK only checks ANDROID_NDK_HOME to locate the NDK. However, Android Studio and Gradle use ANDROID_NDK_ROOT as the standard. This causes friction for developers with existing Android environments.
Who is affected
- Android Studio users (IDE sets
ANDROID_NDK_ROOT) - CI/CD pipelines (GitHub Actions Android setup uses
ANDROID_NDK_ROOT) - Teams with mixed Kotlin/Swift Android projects
Current behavior
echo $ANDROID_NDK_ROOT # /Users/dev/Library/Android/sdk/ndk/27.0.12077973
./setup-android-sdk.sh
# error: ANDROID_NDK_HOME not setProposed Solution
Check both environment variables with ANDROID_NDK_HOME taking precedence:
ANDROID_NDK="${ANDROID_NDK_HOME:-$ANDROID_NDK_ROOT}"
if [ -z "$ANDROID_NDK" ]; then
echo "error: Set ANDROID_NDK_HOME or ANDROID_NDK_ROOT"
exit 1
fiBenefits
- Zero friction for existing Android developers
- Works out-of-the-box with Android Studio
- CI/CD pipelines work without extra config
- Backwards compatible
- One-line fix
Environment
- OS: 26.2 (25C56) (Tahoe)
- Shell: zsh
- Swift: 6.3-DEVELOPMENT-SNAPSHOT
- Android NDK: r27d
- Swift SDK for Android: 6.3 snapshot
Metadata
Metadata
Assignees
Labels
No labels