From b3ac6d4353f8c215b2f57b0201d3249943e56a13 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Wed, 1 Jul 2026 12:56:02 -0500 Subject: [PATCH] fix(build): pin kotlinx-serialization to 1.8.1 for Room migration tests AGP 9's consistent resolution shares the runtime serialization version with the androidTest classpath, where androidx.savedstate pins it to 1.7.3. Room 2.8's schema-bundle serializers are compiled against >= 1.8.0, so MigrationTestHelper threw AbstractMethodError on GeneratedSerializer.typeParametersSerializers(), failing every E2E job. Import the serialization BOM as a platform to force 1.8.1. Verified on-device (API 37): Migration9To10Test fails unpatched, passes patched. Co-Authored-By: Claude Opus 4.8 --- app/build.gradle.kts | 5 +++++ gradle/libs.versions.toml | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6b365c4..c7b0e30 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -189,6 +189,11 @@ dependencies { ksp(libs.androidx.room.compiler) implementation(libs.sqlcipher.android) + // Raise kotlinx-serialization to the version Room's schema-bundle serializers were compiled + // against (see libs.versions.toml). AGP 9 consistent resolution shares it with the androidTest + // classpath so MigrationTestHelper can parse the exported schema JSON. + implementation(platform(libs.kotlinx.serialization.bom)) + testImplementation(libs.junit) testImplementation(libs.kotlin.test) testImplementation(libs.kotlinx.coroutines.test) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 83df43b..9d72eef 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,6 +15,10 @@ sqlcipher = "4.16.0" datastore = "1.2.1" work = "2.11.2" coroutines = "1.10.2" +# Forced above androidx.savedstate's transitive 1.7.3 (shared with the androidTest classpath via +# AGP 9 consistent resolution); Room's schema-bundle serializers need >= 1.8.0 or MigrationTestHelper +# throws AbstractMethodError on GeneratedSerializer.typeParametersSerializers(). +kotlinxSerialization = "1.8.1" appauth = "0.11.1" angusMail = "2.0.5" junit = "4.13.2" @@ -76,6 +80,10 @@ androidx-work-runtime-ktx = { group = "androidx.work", name = "work-runtime-ktx" kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "coroutines" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" } +# Serialization BOM — imported as a platform (not used directly) to raise the transitive +# kotlinx-serialization runtime to the version Room's schema bundles were compiled against. +kotlinx-serialization-bom = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-bom", version.ref = "kotlinxSerialization" } + # Email transport / OAuth — wired in later increments appauth = { group = "net.openid", name = "appauth", version.ref = "appauth" } angus-mail = { group = "org.eclipse.angus", name = "angus-mail", version.ref = "angusMail" }