arnaud.giuliani
02/18/2025, 4:02 PMIvan Carracedo Asensio
02/26/2025, 11:38 AMCLOVIS
03/06/2025, 3:55 PMinterface FooA {
fun foo(name: String, value: Int)
}
interface FooB {
fun foo(value: Int)
}
The two interfaces represent two different ways of interacting with a single entity. In some contexts, the library provides an instance of the first interface, and in some contexts, the library provides an instance of the second interface. However, since they are both used to interact with a single entity, it's more convenient for the library author to implement a single instance that can be viewed as both:
private class FooImpl : FooA, FooB {
override fun foo(name: String, value: Int) {}
override fun foo(value: Int) {}
}
So far, everything is good I think.
I think however there is a risk that a user would use a cast to change their access context even if it's not allowed.
withFooA { // provided by the library
it as FooB // will succeed because FooImpl does implement FooB
it.foo(4) // illegal call to FooB.foo in the context of FooA, but will compile and run
}
Should this be considered a risk? Should I split the implementations of the two interfaces to stop this usage? Or should I consider that this is bad code anyway and I should ignore the fact that users could write it?Cosmin Mihu
03/09/2025, 5:34 AMCLOVIS
03/21/2025, 9:15 PMTomer
04/04/2025, 2:10 PM@UnsafeVariance
. If I am defining some Container<out T>
class and I want one of its methods to return Optional<T>
(for Java users), then is it safe/reasonable to do Optional<@UnsafeVariance T>
? I don't want to do Optional<out T>
since that will end up being Optional<? extends T>
for Java users, which is annoying to work with.
I think using @UnsafeVariance
here makes sense because Optional
is an immutable container so you can only get T
out of it; you can't put a new T
into an existing Optional<T>
. It's just that Java obviously does not define Optional
with out T
at it's declaration (since it's not Kotlin)
Am I making sense? Am I missing anything here?Fudge
04/21/2025, 5:34 PM@Sample
? Usually samples are not part of the main source set, so doesn't that mean samples will always not resolve?andylamax
05/17/2025, 9:15 PM* What went wrong:
Execution failed for task ':kotlinStorePackageLock'.
> Lock file was changed. Run the `kotlinUpgradePackageLock` task to actualize lock file
Simply rerunning the action makes the build pass.
To mitigate this, I have tried running the task kotlinUpgradePackageLock
on CI, before running the build task, but even, that task itself fails sometimes. Anyone facing this issue? How do I solve this?andylamax
05/18/2025, 5:44 AMRafael Costa
05/31/2025, 7:43 AMarnaud.giuliani
07/03/2025, 12:04 PMxxfast
07/06/2025, 7:12 AMTask :publishAllPublicationsToMavenCentralRepository UP-TO-DATE
I was able to run this locally but seems to be always skipping on CI 🤔 has anyone run into this problem before?joseph_ivie
07/10/2025, 3:18 PMAhmed Mourad
07/15/2025, 12:28 AMsettings.gradle
val isDebug = gradle.startParameter.taskNames.any {
it.contains("debug", ignoreCase = true)
}
if (isDebug) {
println("Including local KMP library project for debug")
includeBuild("../sdk")
}
and as a dependency
implementation("dev.ahmedmourad.sdk:core")
it builds and compiles fine, problem is that the IDE (both Android Studio and IntelliJ) fail to resolve anything from the sdk, it's all in red but it build fine
I have Android Studio 2025.1.1 and IntelliJ 2025.1.1.1, both have the Kotlin Multiplatform plugin installed
If anyone has any idea how to get around this please let me know, thank you!ziv kesten
07/16/2025, 6:57 AMeygraber
07/17/2025, 10:36 PMjoseph_ivie
07/21/2025, 4:17 PMOscar
07/23/2025, 12:35 PM@Deprecated
, but this obviously gives warnings on all usages of the given classes. The aim is to warn users to not use these classes, but internally I have to keep support for them. Is there a way to suppress deprecation warnings of my own code without suppressing deprecations from let's say other libraries etc?bod
07/23/2025, 12:46 PM@Deprecated("Use NewName instead")
class OldName
typealias NewName = OldName
// ...
val x = OldName() // <- warning
val y = NewName() // <- warning too, bummer.
joseph_ivie
07/23/2025, 5:02 PMjoseph_ivie
07/23/2025, 7:33 PMjoseph_ivie
07/23/2025, 10:17 PMMugo
07/24/2025, 4:34 PMimport org.gradle.accessors.dm.LibrariesForLibs
plugins {
id("com.android.kotlin.multiplatform.library")
id("id-cmp")
}
val libs = the<LibrariesForLibs>()
kotlin {
jvm("desktop")
// iosX64()
// iosArm64()
// iosSimulatorArm64()
androidLibrary {
experimentalProperties["android.experimental.kmp.enableAndroidResources"] = true
compileSdk = libs.versions.android.compileSdk.get().toInt()
minSdk = libs.versions.android.minSdk.get().toInt()
}
}
The Problem: For the 2 libraries WITHOUT iOS targets - when I try to import them in feature modules of separate apps, I can't access anything from commonMain
. However, I CAN access them from androidMain
and desktopMain
source sets.
Plot twist: The same applications can access classes/packages from their own composeApp
modules just fine.
Anyone seen this before or have ideas? Is this a known KMP issue with partial target configurations?mbonnin
07/29/2025, 9:36 AMjoseph_ivie
07/30/2025, 9:45 PMMez Pahlan
08/03/2025, 7:14 AMWARNING
by default and then removing the signatures on a major version bump. But why, for example, shouldn't I just mark everything as HIDDEN
by default?
What approaches do you take?mbonnin
08/10/2025, 12:42 PMcheckLegacyAbi
is not a dependency of build
anymore? My CI builds are mostly running ./gradlew build
so they have effectively not been checking the ABI any more.mbonnin
08/10/2025, 12:44 PMlegacy
feels weird, my current ABI is not "legacy", it's just a tiny bit "older" than the tip of main
Abhimanyu
08/25/2025, 11:29 AM