Gurupad Mamadapur [FH]
12/23/2019, 2:54 PMplugins {
id "com.android.library"
id 'org.jetbrains.kotlin.multiplatform'
}
repositories {
mavenCentral()
}
android {
compileSdkVersion(28)
buildToolsVersion = "28.0.3"
defaultConfig {
minSdkVersion(16)
targetSdkVersion(28)
}
}
kotlin {
android()
js {
browser {
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
implementation "io.ktor:ktor-client-core:$ktorVersion"
}
}
androidMain {
dependencies {
implementation kotlin('stdlib')
}
}
jsMain {
dependencies {
implementation kotlin('stdlib-js')
}
}
}
}
Here is the root build.gradle -
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.61'
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
ext {
ktorVersion = "1.3.0-rc"
}
Error is -
> Task :shared:compileDebugKotlinAndroid FAILED
e: /Users/fabhotels/Development/testmpp/shared/src/commonMain/kotlin/common.kt: (1, 23): Unresolved reference: HttpClient
e: /Users/fabhotels/Development/testmpp/shared/src/commonMain/kotlin/common.kt: (3, 18): Unresolved reference: HttpClient
The sample project is available here - https://github.com/Protino/testmpp/tree/sample/ktorKris Wong
12/23/2019, 3:06 PMGurupad Mamadapur [FH]
12/23/2019, 3:08 PM