Skip to content

Commit

Permalink
docs: update android build instructions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Oppzippy committed Nov 7, 2024
1 parent 840a968 commit 8010846
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/build-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 8010846

Please sign in to comment.