Tobi
02/11/2019, 4:25 PMpresets.iosArm64
to deploy the app to iPhone
fromPreset(presets.iosX64, ‘iOS’) {
compilations.main.outputKinds(‘FRAMEWORK’)
}
}
sourceSets {
commonMain {
dependencies {
implementation ‘org.jetbrains.kotlin:kotlin-stdlib-common’
implementation “org.jetbrains.kotlinxkotlinx coroutines core common$coroutines_version”
implementation “org.jetbrains.kotlinxkotlinx serialization runtime common$serialization_version”
implementation “io.ktorktor client core$ktor_version”
implementation “io.ktorktor client json$ktor_version”
}
}
commonTest {
dependencies {
implementation ‘org.jetbrains.kotlin:kotlin-test-common’
implementation ‘org.jetbrains.kotlin:kotlin-test-annotations-common’
}
}
androidMain {
dependencies {
implementation ‘org.jetbrains.kotlin:kotlin-stdlib-jdk8’
implementation “org.jetbrains.kotlinxkotlinx coroutines core$coroutines_version”
implementation “org.jetbrains.kotlinxkotlinx serialization runtime$serialization_version”
implementation “io.ktorktor client core jvm$ktor_version”
implementation “io.ktorktor client json jvm$ktor_version”
implementation “io.ktorktor client okhttp$ktor_version”
}
}
androidTest {
dependencies {
implementation ‘org.jetbrains.kotlin:kotlin-test’
implementation ‘org.jetbrains.kotlin:kotlin-test-junit’
api “io.ktorktor client mock jvm$ktor_version”
implementation “com.nhaarman.mockitokotlin2mockito kotlin2.1.0”
implementation “org.mockitomockito inline2.22.0"
}
}
iOSMain {
dependencies {
implementation “org.jetbrains.kotlinxkotlinx coroutines core native$coroutines_version”
implementation “org.jetbrains.kotlinxkotlinx serialization runtime native$serialization_version”
implementation “io.ktorktor client ios$ktor_version”
implementation “io.ktorktor client core native$ktor_version”
implementation “io.ktorktor client json native$ktor_version”
}
}
}io.ktor.client.features.json.JsonFeature
cannot be resolved which should be included in ktor-client-json
Sabrina Namur
02/12/2019, 6:28 AMTobi
02/12/2019, 8:10 AM0.10.0
for kotlinx serialization and besides the test everything works fine.
ext.kotlin_version = ‘1.3.20’
ext.ktor_version = ‘1.1.2’
ext.serialization_version = ‘0.10.0’
ext.coroutines_version = ‘1.1.1’kotlinx/serialization/json/Json
.
Furthermore I isolated the issue into this example repository: https://github.com/tobiasheine/Kotlin-Multiplatform-java.lang.NoClassDefFoundError
just run ./gradlew :common:test
to reproduce the java.lang.NoClassDefFoundError
.
Any help would be much appreciated 🙏