[3.15] Update Android Gradle plugin to version 9.3.1 (GH-155012) (#155038)

hugovk <[email protected]> Sat, 01 Aug 2026 12:31:30 -0400 (EDT)
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/8fb615ee7bca3690d1b9d0b301cdde3f90675f60
commit: 8fb615ee7bca3690d1b9d0b301cdde3f90675f60
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-08-01T16:31:15Z
summary:

[3.15] Update Android Gradle plugin to version 9.3.1 (GH-155012) (#155038)

Update Android Gradle plugin to version 9.3.1 (GH-155012)
(cherry picked from commit 7ce7f0bd8511410bf7c42cc5fc88dfafe07874b6)

Co-authored-by: Malcolm Smith <[email protected]>

files:
M .github/workflows/build.yml
M Platforms/Android/README.md
M Platforms/Android/__main__.py
M Platforms/Android/testbed/app/build.gradle.kts
M Platforms/Android/testbed/build.gradle.kts
M Platforms/Android/testbed/gradle.properties
M Platforms/Android/testbed/gradle/wrapper/gradle-wrapper.properties

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f15dc9f7e178781..52fa7745e901655 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -401,7 +401,7 @@ jobs:
         with:
           persist-credentials: false
       - name: Build and test
-        run: JAVA_HOME="${JAVA_HOME_21_X64:-$JAVA_HOME_21_arm64}" python3 Platforms/Android ci --fast-ci ${{ matrix.arch }}-linux-android
+        run: python3 Platforms/Android ci --fast-ci ${{ matrix.arch }}-linux-android
 
   build-ios:
     name: iOS
diff --git a/Platforms/Android/README.md b/Platforms/Android/README.md
index 54b7f1c46a59db0..0f96a6fd17ec111 100644
--- a/Platforms/Android/README.md
+++ b/Platforms/Android/README.md
@@ -31,7 +31,7 @@ The script also requires the following commands to be on the `PATH`:
 
 * `curl`
 * `java` (or set the `JAVA_HOME` environment variable).
-  Java versions 17 and 21 are supported.
+  Java versions 17, 21 and 25 are supported.
 
 ## Building
 
diff --git a/Platforms/Android/__main__.py b/Platforms/Android/__main__.py
index 705ca6f26221fda..7c4bf9f390741cb 100755
--- a/Platforms/Android/__main__.py
+++ b/Platforms/Android/__main__.py
@@ -393,10 +393,10 @@ def setup_testbed():
     if all((TESTBED_DIR / path).exists() for path in paths):
         return
 
-    # The wrapper version isn't important, as any version of the wrapper can
-    # download any version of Gradle. The Gradle version actually used for the
-    # build is specified in testbed/gradle/wrapper/gradle-wrapper.properties.
-    version = "8.9.0"
+    # Any version of the wrapper can run any reasonably close version of Gradle, so this
+    # doesn't need to match the Gradle version used for the build, which is specified in
+    # testbed/gradle/wrapper/gradle-wrapper.properties.
+    version = "9.5.0"
 
     for path in paths:
         out_path = TESTBED_DIR / path
diff --git a/Platforms/Android/testbed/app/build.gradle.kts b/Platforms/Android/testbed/app/build.gradle.kts
index a56714406803cbf..4d296799c5da68f 100644
--- a/Platforms/Android/testbed/app/build.gradle.kts
+++ b/Platforms/Android/testbed/app/build.gradle.kts
@@ -3,7 +3,6 @@ import kotlin.math.max
 
 plugins {
     id("com.android.application")
-    id("org.jetbrains.kotlin.android")
 }
 
 val ANDROID_DIR = file("../..")
@@ -144,18 +143,10 @@ android {
         path("src/main/c/CMakeLists.txt")
     }
 
-    // Set this property to something nonexistent but non-empty. Otherwise it'll use the
-    // default list, which ignores asset directories beginning with an underscore, and
-    // maybe also other files required by tests.
-    aaptOptions.ignoreAssetsPattern = "android-testbed-dont-ignore-anything"
-
     compileOptions {
         sourceCompatibility = JavaVersion.VERSION_1_8
         targetCompatibility = JavaVersion.VERSION_1_8
     }
-    kotlinOptions {
-        jvmTarget = "1.8"
-    }
 
     testOptions {
         managedDevices {
@@ -192,6 +183,12 @@ android {
             }
         }
     }
+    androidResources {
+        // Set this property to something nonexistent but non-empty. Otherwise it'll use
+        // the default list, which ignores asset directories beginning with an
+        // underscore, and maybe also other files required by tests.
+        ignoreAssetsPattern = "android-testbed-dont-ignore-anything"
+    }
 }
 
 dependencies {
diff --git a/Platforms/Android/testbed/build.gradle.kts b/Platforms/Android/testbed/build.gradle.kts
index 451517b3f1aeab6..3c48be4bb585139 100644
--- a/Platforms/Android/testbed/build.gradle.kts
+++ b/Platforms/Android/testbed/build.gradle.kts
@@ -1,5 +1,4 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 plugins {
-    id("com.android.application") version "8.10.0" apply false
-    id("org.jetbrains.kotlin.android") version "1.9.22" apply false
+    id("com.android.application") version "9.3.1" apply false
 }
diff --git a/Platforms/Android/testbed/gradle.properties b/Platforms/Android/testbed/gradle.properties
index e9f345c8c262501..22821df51100134 100644
--- a/Platforms/Android/testbed/gradle.properties
+++ b/Platforms/Android/testbed/gradle.properties
@@ -11,16 +11,8 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
-# AndroidX package structure to make it clearer which packages are bundled with the
-# Android operating system, and which are packaged with your app's APK
-# https://developer.android.com/topic/libraries/support-library/androidx-rn
-android.useAndroidX=true
 # Kotlin code style for this project: "official" or "obsolete":
 kotlin.code.style=official
-# Enables namespacing of each library's R class so that its R class includes only the
-# resources declared in the library itself and none from the library's dependencies,
-# thereby reducing the size of the R class for that library
-android.nonTransitiveRClass=true
 
 # By default, the app will be uninstalled after the tests finish (apparently
 # after 10 seconds in case of an unclean shutdown). We disable this, because
diff --git a/Platforms/Android/testbed/gradle/wrapper/gradle-wrapper.properties b/Platforms/Android/testbed/gradle/wrapper/gradle-wrapper.properties
index 5d42fbae084da1f..6632d9e5c1c4045 100644
--- a/Platforms/Android/testbed/gradle/wrapper/gradle-wrapper.properties
+++ b/Platforms/Android/testbed/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
 #Mon Feb 19 20:29:06 GMT 2024
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]