Tim Malseed
10/29/2022, 12:15 AMRobert Munro
10/29/2022, 5:12 PMQuerying the mapped value of map(map(task ':remote:jsBrowserDevelopmentWebpack' property 'entryProperty')) before task ':remote:processDceDevJsKotlinJs' has completed is not supported
so this is the task
val outputJsLibName = "remote.js"
// include JS artifacts in any JAR we generate
tasks.getByName<Jar>("jvmJar") {
val taskName = if (project.property("isProduction") == "true") {
"jsBrowserProductionWebpack"
} else {
"jsBrowserDevelopmentWebpack"
}
val webpackTask = tasks.getByName<KotlinWebpack>(taskName)
dependsOn(webpackTask) // make sure JS gets compiled first
from(File(webpackTask.destinationDirectory, outputJsLibName))
}
possibly this isn't the right approach though - what is the best approach to reference a kotlin js lib from a server app?Christian Würthenr
10/31/2022, 8:29 AM<http://Dispatchers.IO|Dispatchers.IO>
available, but that's not the case in KMM. What's the best way to replace it? I already have a expected
actual
with a Dispatcher.SharedIO
which just points to <http://Dispatchers.IO|Dispatchers.IO>
on Android, but what's the best solution on iOS?akapanina
10/31/2022, 10:29 AMayodele
10/31/2022, 3:48 PMKsenia Shneyveys
10/31/2022, 4:02 PMVenkataramanan Parameswaran
10/31/2022, 5:33 PMxcodeConfigurationToNativeBuildType["Staging"] = org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.DEBUG
in cocoapods configuration... This is fine if we have a in house sdks... but if we are publishing this library to outside users. it is not possible to know their build types... then how to handle this kind of issues... ?Sunil Kumar
10/31/2022, 5:39 PMCaused by: kotlinx.serialization.json.internal.JsonDecodingException: Polymorphic serializer was not found for missing class discriminator ('null')
Not able to find any solution for that. Can anyone help me with that. Tried some solutions from google and stackoverflow, but didnt worked.James Ward
10/31/2022, 9:39 PMLim Chee Keong
11/01/2022, 12:03 AMHylke Bron
11/01/2022, 9:53 AM@Throws(Throwable::class) public suspend fun getSomething(): String
because in my experience returning sealed classes with Success / Failure types to swift (via objective c) does not work nicely with swift.
This approach works OK with swift since the exceptions are checked, but when using this same method in android kotlin, there is no checked exceptions so its easy to forget to add a try catch around it.
So I was wondering what your approach is.Edison Yap
11/01/2022, 1:54 PMSlackbot
11/01/2022, 3:45 PMeygraber
11/01/2022, 7:44 PMXCFrameworkTask.outputDir
doesn't use the correct output directory of the xcframework? It's missing the build type directory, which is exposed correctly in outputXCFrameworkFile
but that is protectedLim Chee Keong
11/02/2022, 9:23 AMLim Chee Keong
11/02/2022, 9:26 AMimport org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("kotlin-platform-jvm")
application
kotlin("plugin.serialization")
id("com.github.johnrengelman.shadow") version "7.1.2"
id("com.github.ben-manes.versions") version "0.43.0"
}
dependencies {
implementation(project(":shared"))
with(Deps.Kotlinx) {
implementation(serializationCore) // JVM depende
}
with(Deps.Coroutines){
implementation(core)
}
with(Deps.Ktor) {
implementation(serverCore)
implementation(serverNetty)
implementation(serverCors)
implementation(contentNegotiation)
implementation(json)
}
with(Deps.Log) {
implementation(logback)
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
application {
mainClass.set("ServerKt")
}
there is a implementation to have a dependency to the shared project. However, this is the error I got:
:backend:main: Could not resolve project :shared.
Required by:
project :backend
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.htmlHendrik Marx
11/02/2022, 9:57 AMlet core = Core(myNativeImplementationOfCoreInterfaces())
let l1 = Lib1Class(core) // works
let l2 = Lib2Class(core) // does not work. Core is technically a different class here with the same name
Does anyone know how to make this work or if this is even possible?
I provided a little sketch of the situation.eygraber
11/02/2022, 7:15 PMMichael Paus
11/03/2022, 12:06 PMfun readText(): String
but
fun readText(context: Context): String
on Android. On any other platform than Android there is no Context. Am I supposed to somehow wrap that again in some expect/actual code of my own, or what? I just don’t get it.bartosz.malkowski
11/03/2022, 12:30 PM> Task :common:utils:compileKotlinIosArm64 FAILED
e: Could not find "org.jetbrains.kotlinx:kotlinx-serialization-core" in [/Users/bmalkow/Documents/workspace/tigase-tygrys/common/utils, /Users/bmalkow/.konan/klib, /Users/bmalkow/.konan/kotlin-native-prebuilt-macos-x86_64-1.7.10/klib/common, /Users/bmalkow/.konan/kotlin-native-prebuilt-macos-x86_64-1.7.10/klib/platform/ios_arm64]
or sometimes:
> Task :common:utils:compileKotlinIosArm64 FAILED
e: Could not find "org.jetbrains.kotlinx:kotlinx-datetime" in [/Users/bmalkow/Documents/workspace/tigase-tygrys/common/utils, /Users/bmalkow/.konan/klib, /Users/bmalkow/.konan/kotlin-native-prebuilt-macos-x86_64-1.7.10/klib/common, /Users/bmalkow/.konan/kotlin-native-prebuilt-macos-x86_64-1.7.10/klib/platform/ios_arm64]
Both are used in library I need in my project.
What is wrong?
Im sure it worked few weeks ago, and nobody touch the project for this time. I have no idea what was changed.
Library: https://github.com/tigase/halcyon
Fragment of my project configuration:
plugins {
id("com.github.gmazzo.buildconfig") version "3.1.0"
id("com.android.library")
id("kotlin-multiplatform")
}
buildConfig {
className("OfficialTeaVersion")
packageName("org.tigase.officialtea.common.main.version")
useKotlinOutput()
buildConfigField("String", "APP_NAME", "\"${rootProject.name}\"")
buildConfigField("String", "APP_VERSION", "\"${rootProject.version}\"")
buildConfigField("long", "BUILD_TIME", "${System.currentTimeMillis()}L")
}
android {
compileSdkVersion(deps.versions.androidCompileSdk.get().toInt())
defaultConfig {
minSdkVersion(deps.versions.androidMinSdk.get().toInt())
targetSdkVersion(deps.versions.androidTargetSdk.get().toInt())
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
sourceSets {
named("main") {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
res.srcDirs("src/androidMain/res")
}
}
}
kotlin {
jvm("desktop")
android()
ios()
sourceSets {
named("commonMain") {
dependencies {
implementation(deps.mviKotlin.core)
implementation(deps.mviKotlin.rx)
implementation(deps.mviKotlin.main)
implementation(deps.mviKotlin.extReaktive)
implementation(deps.decompose.decompose)
implementation(deps.reaktive.reaktive)
implementation(deps.halcyon.core)
}
}
named("commonTest") {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
named("androidMain"){}
named("androidTest") {
dependencies {
implementation(deps.kotlin.kotlinTestJunit)
}
}
named("desktopMain") {
dependencies{
implementation(deps.directories)
}
}
named("desktopTest") {
dependencies {
implementation(deps.kotlin.kotlinTestJunit)
}
}
}
}
Francois Desrosiers
11/03/2022, 8:24 PMAlex Styl
11/04/2022, 7:30 AM./gradlew runReleaseDistributable
the app is built and the crashes with Failed to launch JVM
.
If I disable proguard entirely (obfuscate.set(false)
) then runReleaseDistributable runs the app without an issue. I even tried to keep Mainkt
and its contents via a proguard rule (checked the contents of desktop-jvm.jar) and still the same error.
Any pointers would be appreciatedJose Luis Franconetti Olmedo
11/04/2022, 7:46 AMsiraf
11/04/2022, 10:38 AMiosSimulatorArm64
in build.gradle.kts
but it didnt help.
I am getting these kind of errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CLWorkerType", referenced from:
objc-class-ref in WorkerListViewController.o
due to
Undefined symbols for architecture x86_64
Mychael Koelfat
11/04/2022, 12:15 PMclass SharedDiscover {
companion object {
fun parse(deviceId: Int, data: ByteArray, buffer: ByteBuffer): Boolean {
// Some code...
}
}
}
However, it has an unsolved reference to ByteBuffer. This links back to import java.nio.ByteBuffer
in the existing project, but in the shared folder I obviously cannot link to this, or at least not in this way. Does anyone have a workaround? Or any insight on how this works?Moritz Post
11/04/2022, 2:14 PMcommon
source folder. I have added kotlinx.serialization
and am using it successfully in the app. However in the AndroidStudio source editor all classes from the serialization library are marked as unresolved and no tooling works for them. Is anybody aware of such an issue?Damian Nowak
11/05/2022, 2:19 PMKy
11/05/2022, 5:06 PMshared
layer build.gradle.kts
I receive an error when trying to gradle sync.
Failed building KotlinMPPGradleModel
java.util.NoSuchElementException: Collection is empty.
Marc Reichelt
11/07/2022, 9:05 AMChristian Würthenr
11/07/2022, 2:28 PMdebugImplementation
and releaseImplementation
in KMM? I have some dependencies that should go into the androidMain
source set but with different dependencies for debug and release buildsChristian Würthenr
11/07/2022, 2:28 PMdebugImplementation
and releaseImplementation
in KMM? I have some dependencies that should go into the androidMain
source set but with different dependencies for debug and release buildsephemient
11/07/2022, 2:30 PMdependencies
block instead of the one in the Kotlin blockChristian Würthenr
11/07/2022, 2:32 PM