Skip to content

Bump Android externalNativeBuild CMake 3.10.2 -> 3.22.1#1468

Open
bmehta001 wants to merge 2 commits into
microsoft:mainfrom
bmehta001:bhamehta/android-cmake-3.22.1
Open

Bump Android externalNativeBuild CMake 3.10.2 -> 3.22.1#1468
bmehta001 wants to merge 2 commits into
microsoft:mainfrom
bmehta001:bhamehta/android-cmake-3.22.1

Conversation

@bmehta001

@bmehta001 bmehta001 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Bump the Android externalNativeBuild CMake from 3.10.2 to 3.22.1, and update every place that installs or documents that version so the Gradle pin and the installed SDK CMake stay in sync.

Why

3.10.2 is the legacy Google-forked CMake. It was deprecated as the Android Gradle Plugin default (the AGP default moved off 3.10.2 to 3.18.1, with 3.22.1 recommended) and is no longer guaranteed to be installed by the SDK Manager. There is no published removal date, so this is a modernization (not an emergency), but keeping the deprecated fork pinned is a latent risk. 3.22.1 is the modern upstream-based CMake that already ships with the pinned NDK 27 this repo uses, so no new toolchain component is required.

This addresses the remaining open item (CMake) of #1095; the rest of that issue (Gradle 8.5, AGP 8.2.2, compileSdk 34, modern test deps) already landed via #1103 / #1298 / #1358 / #1394.

Changes

The Gradle pin and the CMake the CI/scripts install must match, or the build fails with "CMake 3.22.1 not found", so all are updated together:

File Change
lib/android_build/maesdk/build.gradle, app/build.gradle externalNativeBuild { cmake { version } } 3.10.2 → 3.22.1
.github/workflows/build-android.yml, codeql-analysis.yml sdkmanager installs cmake;3.22.1
.github/workflows/test-android-mac.yml.off (disabled) cmake: input → 3.22.1 (consistency)
build-android.cmd, tools/build-android-aar.sh default ANDROID_CMAKE_VERSION / CMAKE_VERSION_DEFAULT + help text
docs/cpp-start-android.md documented default

The native maesdk/src/main/cpp/CMakeLists.txt keeps cmake_minimum_required(VERSION 3.10.2) as its compatibility floor — only the CMake tool version used to build is bumped, not the minimum the project claims to support. (Raising the floor would change CMake policy defaults and is a separate, riskier change.)

Validation

Confirmed via CI

CMake 3.10.2 is the legacy Google-forked CMake, deprecated as the Android
Gradle Plugin default and no longer guaranteed to be installed by the SDK
Manager. 3.22.1 is the modern upstream-based CMake that already ships with
the pinned NDK 27.

Update every place that pins or installs the externalNativeBuild CMake so
the Gradle pin and the installed SDK CMake stay in sync:
- lib/android_build/{maesdk,app}/build.gradle: externalNativeBuild version
- .github/workflows/build-android.yml, codeql-analysis.yml: sdkmanager install
- .github/workflows/test-android-mac.yml.off (disabled): cmake input
- build-android.cmd, tools/build-android-aar.sh: default version + help text
- docs/cpp-start-android.md: documented default

The maesdk native CMakeLists keeps cmake_minimum_required(VERSION 3.10.2)
as its compatibility floor; only the CMake tool version used to build is
bumped.

Refs microsoft#1095.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bmehta001 bmehta001 requested a review from a team as a code owner June 8, 2026 20:20
@bmehta001 bmehta001 requested a review from Copilot June 8, 2026 20:44
@bmehta001 bmehta001 self-assigned this Jun 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the Android build toolchain by bumping the Gradle externalNativeBuild CMake version pin from 3.10.2 to 3.22.1 and aligning CI/scripts/docs so the pinned Gradle version and installed SDK CMake version remain consistent.

Changes:

  • Update Android Gradle externalNativeBuild.cmake.version from 3.10.2 to 3.22.1 (both maesdk and app modules).
  • Update GitHub Actions workflows to install cmake;3.22.1 via sdkmanager.
  • Update local build scripts/docs defaults to use 3.22.1 (including PATH / help text).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/build-android-aar.sh Updates default CMake version used for local AAR build + sdkmanager install path.
lib/android_build/maesdk/build.gradle Pins externalNativeBuild CMake version to 3.22.1 for the SDK module.
lib/android_build/app/build.gradle Pins externalNativeBuild CMake version to 3.22.1 for the sample/app module.
docs/cpp-start-android.md Updates documented default ANDROID_CMAKE_VERSION to 3.22.1.
build-android.cmd Updates default ANDROID_CMAKE_VERSION (and thus PATH cmake folder) to 3.22.1.
.github/workflows/test-android-mac.yml.off Updates the (disabled) mac workflow’s CMake input for consistency.
.github/workflows/codeql-analysis.yml Installs cmake;3.22.1 in the Windows CodeQL workflow to match the Gradle pin.
.github/workflows/build-android.yml Installs cmake;3.22.1 in the Windows Android build workflow to match the Gradle pin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants