Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document NDK upgrade process #112885

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion docs/workflow/testing/libraries/testing-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Android SDK and NDK can be automatically installed via the following script:
#!/usr/bin/env bash
set -e

NDK_VER=r23c
NDK_VER=r27c
Copy link
Member

Choose a reason for hiding this comment

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

Should we update our codespaces container definition? (I can do it, just want to make sure its the right thing to do)

SDK_VER=9123335_latest
SDK_API_LEVEL=33
SDK_BUILD_TOOLS=33.0.1
Expand Down Expand Up @@ -154,3 +154,29 @@ The emulator can be launched with a variety of options. Run `emulator -help` to
### Debugging the native runtime code using Android Studio

See [Debugging Android](../../debugging/mono/android-debugging.md)

## Upgrading the Android NDK Version in CI Pipelines

The Android NDK LTS version is released annually. CI pipelines retrieve the NDK version from Docker images hosted in the [dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repository.
For reference, see an example Dockerfile:
[Azure Linux 3.0 .NET 10.0 Android Dockerfile](https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/main/src/azurelinux/3.0/net10.0/android/amd64/Dockerfile).

To upgrade the NDK version used in CI for building and testing Android, follow these steps:

### 1. Verify the New NDK Version Locally
- Download the new NDK version.
- Test the local build using the new NDK by building a sample Android app.
- Ensure **AOT** and **AOT_WITH_LIBRARY_FILES** are enabled in the build.
Copy link
Preview

Copilot AI Feb 24, 2025

Choose a reason for hiding this comment

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

The phrase 'Ensure AOT and AOT_WITH_LIBRARY_FILES are enabled in the build' could be clearer if 'AOT' is defined. Consider specifying what 'AOT' stands for.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options

### 2. Test the New NDK in CI and Fix Issues
- Create a new Docker image containing the updated NDK version.
- Open a **draft PR** in the **runtime** repository that updates the Dockerfile reference to use the new image.
- Monitor CI results and fix any failures.
- Once CI is green, **commit only the necessary changes** (e.g., fixes, build adjustments) to the respective branch.
- **Do not** change the Docker image reference in the final commit.

### 3. Update the NDK Version in the Prerequisites Repository
- Update the NDK version in the [dotnet-buildtools-prereqs-docker](https://github.com/dotnet/dotnet-buildtools-prereqs-docker) repository by modifying the Dockerfile.
- The updated NDK will automatically flow to all builds of a given branch once merged.

By following these steps, you ensure a smooth upgrade of the Android NDK in CI while maintaining stability and compatibility.