From cd3258f9ce9a8e578f0dba48b182d7e3e191d41d Mon Sep 17 00:00:00 2001 From: Alex Lohr <165764739+alex-crabnebula@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:58:56 +0200 Subject: [PATCH] docs: make android ndk path reliable (#2081) --- src/content/docs/start/prerequisites.mdx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/content/docs/start/prerequisites.mdx b/src/content/docs/start/prerequisites.mdx index 793565c0d2..a2a39ac463 100644 --- a/src/content/docs/start/prerequisites.mdx +++ b/src/content/docs/start/prerequisites.mdx @@ -263,16 +263,16 @@ export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home" - Android SDK Build-Tools - Android SDK Command-line Tools -4. Set `ANDROID_HOME` and `NDK_HOME` environment variables. Replace the version numbers so it matches your installed version. +Selecting "Show Package Details" in the SDK Manager enables the installation of older package versions. Only install older versions if necessary, as they may introduce compatibility issues or security risks. -{/* TODO: Does the version number change below? */} +4. Set `ANDROID_HOME` and `NDK_HOME` environment variables. ```sh export ANDROID_HOME="$HOME/Android/Sdk" -export NDK_HOME="$ANDROID_HOME/ndk/25.0.8775105" +export NDK_HOME="$ANDROID_HOME/ndk/$(ls -1 $ANDROID_HOME/ndk)" ``` @@ -280,17 +280,16 @@ export NDK_HOME="$ANDROID_HOME/ndk/25.0.8775105" ```sh export ANDROID_HOME="$HOME/Library/Android/sdk" -export NDK_HOME="$ANDROID_HOME/ndk/25.0.8775105" +export NDK_HOME="$ANDROID_HOME/ndk/$(ls -1 $ANDROID_HOME/ndk)" ``` -{/* TODO: Do we need a note about this version? */} - ```ps [System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LocalAppData\Android\Sdk", "User") -[System.Environment]::SetEnvironmentVariable("NDK_HOME", "$env:LocalAppData\Android\Sdk\ndk\25.0.8775105", "User") +$VERSION = Get-ChildItem -Path "$env:LocalAppData\Android\Sdk\ndk" +[System.Environment]::SetEnvironmentVariable("NDK_HOME", "$env:LocalAppData\Android\Sdk\ndk\$VERSION", "User") ```