summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson@mullvad.net>2025-07-31 15:38:13 +0200
committerDavid Göransson <david.goransson@mullvad.net>2025-08-01 09:48:08 +0200
commit754677a648ad6580f5546f0b83ea5765cfd97b3d (patch)
treef7c1c32538f06a262c5d3086f4e4512af288eb4a /android
parent212c9c1aabe17763f0ed807b2d3fca15f2305c8b (diff)
downloadmullvadvpn-754677a648ad6580f5546f0b83ea5765cfd97b3d.tar.xz
mullvadvpn-754677a648ad6580f5546f0b83ea5765cfd97b3d.zip
Fix ktor parsing error
App module had transitive dependencies using a older version at runtime of serializationx. However, when compiling the test:e2e module a later version than 1.8.0 was used through ktor. This caused deserialization in runtime to go looking for a method that didn't exist. By putting an explicit version in the app module we make sure to use a version that is compatible with ktor.
Diffstat (limited to 'android')
-rw-r--r--android/app/build.gradle.kts10
-rw-r--r--android/gradle/libs.versions.toml5
-rw-r--r--android/test/e2e/build.gradle.kts5
3 files changed, 14 insertions, 6 deletions
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index f679193ba6..ba2e371fd5 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -434,8 +434,6 @@ dependencies {
// Leak canary
leakCanaryImplementation(libs.leakCanary)
- // Needed for createComposeExtension() and createAndroidComposeExtension()
- debugImplementation(libs.compose.ui.test.manifest)
testImplementation(projects.lib.commonTest)
testImplementation(libs.kotlin.test)
testImplementation(libs.kotlinx.coroutines.test)
@@ -445,7 +443,15 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
testImplementation(libs.junit.jupiter.params)
+ // HACK:
+ // Not used by app module, but otherwise an older version pre 1.8.0 will be used at runtime for
+ // the e2e tests. This causes the deserialization to fail because of a missing function that was
+ // introduced in 1.8.0.
+ implementation(libs.kotlinx.serialization.json)
+
// UI test dependencies
+
+ // Needed for createComposeExtension() and createAndroidComposeExtension()
debugImplementation(libs.compose.ui.test.manifest)
androidTestImplementation(libs.koin.test)
androidTestImplementation(libs.kotlin.test)
diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml
index 92fb8b5048..3e0e6fceb3 100644
--- a/android/gradle/libs.versions.toml
+++ b/android/gradle/libs.versions.toml
@@ -65,7 +65,6 @@ koin = "4.1.0"
koin-compose = "4.1.0"
# Ktor
-# Bumping to 3.1.0 causes an AbstractMethodError in the serialization logic (DROID-1820).
ktor = "3.2.3"
# Kotlin
@@ -74,7 +73,7 @@ ktor = "3.2.3"
kotlin = "2.2.0"
kotlin-ksp = "2.2.0-2.0.2"
kotlinx = "1.10.2"
-kotlinx-serialization = "1.8.1"
+kotlinx-serialization-json = "1.9.0"
# Protobuf
protobuf-gradle-plugin = "0.9.5"
@@ -121,6 +120,7 @@ androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-
androidx-test-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androidx-uiautomator" }
androidx-test-orchestrator = { module = "androidx.test:orchestrator", version.ref = "androidx-testorchestrator" }
androidx-tv = { module = "androidx.tv:tv-material", version.ref = "androidx-tv" }
+androidx-ui-test = { module = "androidx.compose.ui:ui-test", version.ref = "compose" }
# Arrow
arrow = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" }
@@ -180,6 +180,7 @@ kotlin-native-prebuilt = { module = "org.jetbrains.kotlin:kotlin-native-prebuilt
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx" }
+kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
# Ktor
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
diff --git a/android/test/e2e/build.gradle.kts b/android/test/e2e/build.gradle.kts
index c8c91df24f..5fe61b878f 100644
--- a/android/test/e2e/build.gradle.kts
+++ b/android/test/e2e/build.gradle.kts
@@ -114,8 +114,11 @@ dependencies {
implementation(libs.androidx.test.runner)
implementation(libs.androidx.test.rules)
implementation(libs.androidx.test.uiautomator)
+ implementation(libs.androidx.ui.test)
implementation(libs.kermit)
implementation(libs.junit.jupiter.api)
+ implementation(libs.junit5.android.test.core)
+ implementation(libs.junit5.android.test.compose)
implementation(libs.junit5.android.test.extensions)
implementation(libs.junit5.android.test.runner)
implementation(libs.kotlin.stdlib)
@@ -126,11 +129,9 @@ dependencies {
implementation(libs.ktor.serialization.kotlinx.json)
implementation(libs.ktor.client.content.negotiation)
implementation(libs.ktor.client.resources)
-
androidTestUtil(libs.androidx.test.orchestrator)
// Needed or else the app crashes when launched
- implementation(libs.junit5.android.test.compose)
implementation(libs.compose.material3)
// Need these for forcing later versions of dependencies