Skip to content

Commit d34d434

Browse files
committed
Update to Android Gradle plugin version 9.2.0
1 parent 9f563f4 commit d34d434

12 files changed

Lines changed: 96 additions & 18 deletions

File tree

demo/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all
22
// sub-projects/modules.
33
plugins {
4-
id("com.android.application") version "9.1.1" apply false
4+
id("com.android.application") version "9.2.0" apply false
55

66
// com.chaquo.python is declared in settings.gradle.kts, because dynamic versions
77
// are not possible here. See

demo/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
plugins {
3+
id("com.android.application") version "{{ agpVersion }}" apply false
4+
id("com.android.library") version "{{ agpVersion }}" apply false
5+
id("com.android.dynamic-feature") version "{{ agpVersion }}" apply false
6+
id("com.chaquo.python") version "{{ chaquopyVersion }}" apply false
7+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
chaquopy.javaVersion=21
2+
chaquopy.agpVersion=9.2.0
3+
4+
# Avoid including the Kotlin standard library in the app.
5+
android.builtInKotlin=false
6+
7+
# Gradle Daemon will terminate itself after specified number of idle milliseconds.
8+
# Default is 10800000 (3 hours), but that can overload the machine when running
9+
# integration tests on many versions. Reduce to 30 minutes.
10+
org.gradle.daemon.idletimeout=1800000
11+
12+
# Default settings generated by the new project wizard:
13+
14+
# Specifies the JVM arguments used for the daemon process.
15+
# The setting is particularly useful for tweaking memory settings.
16+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
17+
# When configured, Gradle will run in incubating parallel mode.
18+
# This option should only be used with decoupled projects. For more details, visit
19+
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
20+
# org.gradle.parallel=true
21+
# Kotlin code style for this project: "official" or "obsolete":
22+
kotlin.code.style=official
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionSha256Sum=2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
5+
networkTimeout=10000
6+
validateDistributionUrl=true
7+
zipStoreBase=GRADLE_USER_HOME
8+
zipStorePath=wrapper/dists
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
pluginManagement {
2+
repositories {
3+
maven { url = uri("""{{ chaquopyRepository }}""") }
4+
google {
5+
content {
6+
includeGroupByRegex("com\\.android.*")
7+
includeGroupByRegex("com\\.google.*")
8+
includeGroupByRegex("androidx.*")
9+
}
10+
}
11+
mavenCentral()
12+
gradlePluginPortal()
13+
}
14+
}
15+
plugins {
16+
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
17+
}
18+
dependencyResolutionManagement {
19+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
20+
repositories {
21+
google()
22+
mavenCentral()
23+
}
24+
}
25+
26+
rootProject.name = "My Application"
27+
28+
for (f in rootDir.listFiles()!!) {
29+
for (ext in listOf("gradle", "gradle.kts")) {
30+
if (File(f, "build.$ext").exists()) {
31+
include(f.name)
32+
break
33+
}
34+
}
35+
}

product/gradle-plugin/src/test/integration/test_gradle_plugin.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,22 +2070,28 @@ def dex_classes(apk_dir):
20702070
dexdump_cmd = f"{build_tools_dir}/{newest_ver}/dexdump"
20712071

20722072
classes = {}
2073-
file_num = 1
2073+
file_num = 0
20742074
while True:
20752075
# Multidex is used by default in debug builds when minSdkVersion is 21 or higher
20762076
# (https://developer.android.com/studio/build/multidex).
2077+
file_num += 1
20772078
dex_filename = f"{apk_dir}/classes{file_num if (file_num > 1) else ''}.dex"
2078-
if exists(dex_filename):
2079-
for line in run([dexdump_cmd, dex_filename], check=True, capture_output=True,
2080-
text=True).stdout.splitlines():
2081-
match = re.search(r"Class descriptor *: *'L(.*);'", line)
2082-
if match:
2083-
package, _, name = match[1].replace("/", ".").rpartition(".")
2084-
if not exclude_class(name):
2085-
classes.setdefault(package, []).append(name)
2086-
else:
2079+
if not exists(dex_filename):
20872080
break
2088-
file_num += 1
2081+
2082+
pending_class = None
2083+
for line in run([dexdump_cmd, dex_filename], check=True, capture_output=True,
2084+
text=True).stdout.splitlines():
2085+
if match := re.search(r"Class descriptor *: *'L(.*);'", line):
2086+
package, _, name = match[1].replace("/", ".").rpartition(".")
2087+
if not exclude_class(name):
2088+
pending_class = (package, name)
2089+
elif pending_class:
2090+
# AGP 9.2 generates hundreds of synthetic classes for Android APIs.
2091+
if "SYNTHETIC" not in line:
2092+
package, name = pending_class
2093+
classes.setdefault(package, []).append(name)
2094+
pending_class = None
20892095

20902096
return classes
20912097

product/runtime/docs/sphinx/android.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In your *top-level* `build.gradle` file, set the Chaquopy version:
3838
}
3939
4040
Also check the Android Gradle plugin version (`com.android.application` or
41-
`com.android.library`): it should be between 7.3.x and 9.1.x. Older versions are
41+
`com.android.library`): it should be between 7.3.x and 9.2.x. Older versions are
4242
supported by :doc:`older versions of Chaquopy <../versions>`. Newer versions may work,
4343
but have not been tested.
4444

product/runtime/docs/sphinx/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Features
1919
<https://github.com/chaquo/chaquopy/issues/981>`__)
2020
- Improved detection of changes to :ref:`buildPython`. (`#991
2121
<https://github.com/chaquo/chaquopy/issues/991>`__)
22-
- Android Gradle plugin versions 9.0 to 9.1 are now supported. (`#1096
22+
- Android Gradle plugin versions 9.0 to 9.2 are now supported. (`#1096
2323
<https://github.com/chaquo/chaquopy/issues/1096>`__)
2424
- Devices with 16 KB pages are now supported by Chaquopy itself. However, many
2525
existing Android wheels will still fail to load on 16 KB devices. For best

product/runtime/docs/sphinx/versions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Version summary
99
| | |Gradle plugin |level |
1010
| | |versions | |
1111
+===================+===================+===================+===================+
12-
|17.0 |3.10 - 3.14 |7.3 - 9.1 | |
12+
|17.0 |3.10 - 3.14 |7.3 - 9.2 | |
1313
+-------------------+-------------------+-------------------+ |
1414
|16.1 | |7.0 - 8.13 | |
1515
+-------------------+ +-------------------+ |

0 commit comments

Comments
 (0)