From 80108467116bdb870bda19cc8a2d5aaec22da43f Mon Sep 17 00:00:00 2001 From: Kyle Scheuing Date: Thu, 7 Nov 2024 04:02:34 -0500 Subject: [PATCH] docs: update android build instructions ANDROID_NDK_HOME is no longer used when stripping debug info from binaries. It still needs to be set for cargo-ndk, though. Gradle build scripts were migrated to kotlin a long time ago, so the file paths to the build scripts should end in .kts If symlinks in toolchains/llvm/prebuilt/linux-x86_64/bin/ are not preserved, you'll get an execve error when running cargo ndk. I'm adding a note about it since it is a non trivial error message to diagnose. --- docs/build-android.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/build-android.md b/docs/build-android.md index aa5aa21d..8365269e 100644 --- a/docs/build-android.md +++ b/docs/build-android.md @@ -3,13 +3,13 @@ ### If you do not have Android Studio installed: 1. Install a JDK distribution of your choice -2. Download the [Android command line tools (scroll down a bit)](https://developer.android.com/studio), extract it, and set the `ANDROID_HOME` environment variable to the cmdline-tools directory (the one containing `NOTICE.txt`). -3. Accept licenses by `cd`ing to cmdline-tools/bin and run `./sdkmanager --licenses --sdk_root=..`. -4. Check the version of ndk listed in [`android/app/build.gradle`](https://github.com/Oppzippy/OpenSCQ30/blob/master/android/app/build.gradle) (Ctrl-F ndkVersion) and [download that version of the ndk](https://developer.android.com/ndk/downloads), extract it, and set the `ANDROID_NDK_HOME` environment variable to the directory inside containing `NOTICE`. +2. Download the [Android command line tools (scroll down a bit)](https://developer.android.com/studio), extract it to `~/Android/Sdk` (or somewhere else, this is just where Android Studio puts it), and set the `ANDROID_HOME` environment variable to `~/Android/Sdk`. +3. Accept licenses by running `$ANDROID_HOME/cmdline-tools/bin/sdkmanager --licenses --sdk_root=$ANDROID_HOME`. +4. Check the ndk version required for the commit you have checked out (it's listed in listed in [`android/app/build.gradle.kts`](https://github.com/Oppzippy/OpenSCQ30/blob/master/android/app/build.gradle.kts), Ctrl-F ndkVersion) and [download that version of the ndk](https://developer.android.com/ndk/downloads), extract it to `$ANDROID_HOME/ndk/your_ndk_version_number` (and ensure symlinks are preserved), and set the `ANDROID_NDK_HOME` environment variable to `$ANDROID_HOME/ndk/your_ndk_version_number`. ### If you do have Android Studio installed: -1. Ensure the version of ndk listed in [`android/app/build.gradle`](https://github.com/Oppzippy/OpenSCQ30/blob/master/android/app/build.gradle) (Ctrl-F ndkVersion) is installed (File -> Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools). +1. Ensure the version of ndk listed in [`android/app/build.gradle.kts`](https://github.com/Oppzippy/OpenSCQ30/blob/master/android/app/build.gradle.kts) (Ctrl-F ndkVersion) is installed (File -> Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools). ### Then: