diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 348c0485c..28bd8766a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -25,6 +25,7 @@ OptIn annotations on interfaces and functions will now be propagated to the gene - Fixed documentation for converters to match the current version. - Unresolved reference setBody in generated API implementations [#726](https://github.com/Foso/Ktorfit/issues/726) +- [Android] App crashes if not using Ktor platform client [#720](https://github.com/Foso/Ktorfit/issues/720) # [2.1.0]() diff --git a/example/AndroidOnlyExample/app/build.gradle.kts b/example/AndroidOnlyExample/app/build.gradle.kts index 7b2ad76e6..54ba93225 100644 --- a/example/AndroidOnlyExample/app/build.gradle.kts +++ b/example/AndroidOnlyExample/app/build.gradle.kts @@ -1,9 +1,9 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") - id("com.google.devtools.ksp") version "2.0.20-1.0.24" + id("com.google.devtools.ksp") version "2.0.21-1.0.27" id("org.jetbrains.kotlin.plugin.serialization") version "2.0.21" - id("de.jensklingenberg.ktorfit") version "2.0.1" + id("de.jensklingenberg.ktorfit") version "2.1.0" id("org.jetbrains.kotlin.plugin.compose") version "2.0.21" } @@ -52,8 +52,8 @@ tasks.withType().configureEach } } -val ktorfit = "2.0.0" -val ktor = "2.3.11" +val ktorfit = "2.1.0" +val ktor = "3.0.1" val compose_ui_version = "1.7.4" dependencies { implementation("de.jensklingenberg.ktorfit:ktorfit-lib:$ktorfit") @@ -63,8 +63,6 @@ dependencies { implementation("de.jensklingenberg.ktorfit:ktorfit-converters-response:$ktorfit") implementation("de.jensklingenberg.ktorfit:ktorfit-converters-call:$ktorfit") implementation("de.jensklingenberg.ktorfit:ktorfit-converters-flow:$ktorfit") - - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6") implementation("androidx.activity:activity-compose:1.9.3") implementation("androidx.compose.ui:ui:$compose_ui_version") diff --git a/example/MultiplatformExample/shared/build.gradle.kts b/example/MultiplatformExample/shared/build.gradle.kts index 7a7e897ee..cce0a06f1 100644 --- a/example/MultiplatformExample/shared/build.gradle.kts +++ b/example/MultiplatformExample/shared/build.gradle.kts @@ -4,7 +4,7 @@ plugins { kotlin("multiplatform") kotlin("native.cocoapods") id("com.android.library") - id("com.google.devtools.ksp") version "2.0.21-1.0.25" + id("com.google.devtools.ksp") version "2.0.21-1.0.27" id("kotlinx-serialization") id("de.jensklingenberg.ktorfit") version "2.1.0" } @@ -15,7 +15,7 @@ ktorfit { } version = "1.0" -val ktorVersion = "2.3.11" +val ktorVersion = "3.0.1" val ktorfitVersion = "2.1.0" kotlin { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a53c5e9a7..ee4f87776 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -60,7 +60,7 @@ ktor-client-core-mingwx64 = { module = "io.ktor:ktor-client-core-mingwx64", vers ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktorVersion" } ktor-client-ios = { module = "io.ktor:ktor-client-ios", version.ref = "ktorVersion" } ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktorVersion" } - +ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktorVersion" } ktor-client-json-js = { module = "io.ktor:ktor-client-json-js", version.ref = "ktorVersion" } ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktorVersion" } ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktorVersion" } diff --git a/ktorfit-lib/build.gradle.kts b/ktorfit-lib/build.gradle.kts index b6a07a7f3..823c0c30a 100644 --- a/ktorfit-lib/build.gradle.kts +++ b/ktorfit-lib/build.gradle.kts @@ -1,4 +1,3 @@ -import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -116,7 +115,7 @@ kotlin { } val androidMain by getting { dependencies { - implementation(libs.ktor.client.cio.jvm) + implementation(libs.ktor.client.okhttp) } } val jvmMain by getting { @@ -134,7 +133,11 @@ kotlin { } } - val iosMain by getting + val iosMain by getting { + dependencies { + implementation(libs.ktor.client.ios) + } + } } } val javadocJar by tasks.registering(Jar::class) {