https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
n

Nikolai

11/09/2018, 6:16 AM
Hi, everyone Another simple question, I guess. I am trying to solve it, but can’t understand what I am doing wrong. I am using IDEA, selecting : new project - kotlin- mobile android/ios. And get the default project. After that I want to import ktor (to implement client-server connection). I added :
maven { url "<https://dl.bintray.com/kotlin/ktor/>" }
to repositories list. Then I went through all sourceSets and add:
implementation "io.ktor:ktor-client-core:1.0.0-beta-3"
- for common module
implementation "io.ktor:ktor-client-android:1.0.0-beta-3"
- android
implementation "io.ktor:ktor-client-core-ios:1.0.0-beta-3"
- ios run “assemble” task of the gradle, everything ok. After that I add some simple code to common module:
private val client = io.ktor.client.HttpClient()
(btw I didn’t get any autocomplete or suggestions from IDE, but at least after I entered whole line it was ok). After that I tried to run “assemble” again, but got an error :
z

Zahar

11/09/2018, 7:07 AM
Try to add
implementation "io.ktor:ktor-client-okhttp:1.0.0-beta-3"
👍 1
n

Nikolai

11/09/2018, 8:29 AM
@Zahar Thanks for the suggestion, but this didn’t helped (see answer in replies to my later post)