Bump Android externalNativeBuild CMake 3.10.2 -> 3.22.1#1468
Open
bmehta001 wants to merge 2 commits into
Open
Conversation
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>
Contributor
There was a problem hiding this comment.
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.versionfrom3.10.2to3.22.1(bothmaesdkandappmodules). - Update GitHub Actions workflows to install
cmake;3.22.1viasdkmanager. - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bump the Android
externalNativeBuildCMake 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.2is 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.1is 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:
lib/android_build/maesdk/build.gradle,app/build.gradleexternalNativeBuild { cmake { version } }3.10.2 → 3.22.1.github/workflows/build-android.yml,codeql-analysis.ymlsdkmanagerinstallscmake;3.22.1.github/workflows/test-android-mac.yml.off(disabled)cmake:input → 3.22.1 (consistency)build-android.cmd,tools/build-android-aar.shANDROID_CMAKE_VERSION/CMAKE_VERSION_DEFAULT+ help textdocs/cpp-start-android.mdThe native
maesdk/src/main/cpp/CMakeLists.txtkeepscmake_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