François
07/05/2025, 9:18 AMDan Kaser
07/07/2025, 2:28 PMGhasem Shirdel
07/07/2025, 6:09 PMsupportsMainMenu, which I naturally don’t use anywhere in the iOSApp code. Is this being used in the background by Compose?
The second issue happens when the function stackTraceToString is called — a leak occurs. Libraries like Napier and other logging libraries use this function. Is this problem only present in debug mode?
My Compose version is 1.8.1 and Kotlin version is 2.2.0.
Thread in Slack ConversationGhasem Shirdel
07/07/2025, 6:09 PMcafonsomota
07/10/2025, 4:55 PMsmallBinary feature released on 2.2.20-Beta1 but I didn’t noticed any change on the frameworks size; I’ve tested both added on gradle.properties and on build.gradle.kts. Am I missing something? 🤔Mikolaj
07/15/2025, 1:13 PMDmitriy Tarasevich
07/18/2025, 2:28 AMException in thread "main" java.lang.IllegalStateException: Unresolved classifier: platform/darwin/NSObjectProtocolMeta
at org.jetbrains.kotlin.commonizer.metadata.CirDeserializers.type(CirDeserializers.kt:655)
at org.jetbrains.kotlin.commonizer.metadata.CirDeserializers.clazz(CirDeserializers.kt:241)
at org.jetbrains.kotlin.commonizer.tree.deserializer.CirTreeClassDeserializer.invoke(CirTreeClassDeserializer.kt:32)
at org.jetbrains.kotlin.commonizer.tree.deserializer.CirTreePackageDeserializer.invoke(CirTreePackageDeserializer.kt:41)
at org.jetbrains.kotlin.commonizer.tree.deserializer.CirTreeModuleDeserializer.invoke(CirTreeModuleDeserializer.kt:32)
at org.jetbrains.kotlin.commonizer.tree.deserializer.RootCirTreeDeserializer.invoke(RootCirTreeDeserializer.kt:37)
at org.jetbrains.kotlin.commonizer.FacadeKt.deserializeTarget(facade.kt:38)
at org.jetbrains.kotlin.commonizer.FacadeKt.deserializeTarget(facade.kt:44)
at org.jetbrains.kotlin.commonizer.CommonizerQueueKt.CommonizerQueue$lambda$1$lambda$0(CommonizerQueue.kt:22)
at org.jetbrains.kotlin.commonizer.CommonizerQueue.deserializedTargets$lambda$1$lambda$0(CommonizerQueue.kt:56)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
at org.jetbrains.kotlin.commonizer.CommonizerQueue.commonize(CommonizerQueue.kt:106)
at org.jetbrains.kotlin.commonizer.CommonizerQueue.enqueue$lambda$6(CommonizerQueue.kt:97)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
at org.jetbrains.kotlin.commonizer.CommonizerQueue.invokeTarget(CommonizerQueue.kt:90)
at org.jetbrains.kotlin.commonizer.CommonizerQueue.invokeAll(CommonizerQueue.kt:83)
at org.jetbrains.kotlin.commonizer.FacadeKt.runCommonization(facade.kt:32)
at org.jetbrains.kotlin.commonizer.konan.LibraryCommonizer.commonizeAndSaveResults(LibraryCommonizer.kt:51)
at org.jetbrains.kotlin.commonizer.konan.LibraryCommonizer.run(LibraryCommonizer.kt:30)
at org.jetbrains.kotlin.commonizer.cli.NativeKlibCommonize.execute(nativeTasks.kt:79)
at org.jetbrains.kotlin.commonizer.cli.CommonizerCLI.executeTasks(cli.kt:60)
at org.jetbrains.kotlin.commonizer.cli.CommonizerCLI.main(cli.kt:17)
No idea where to go from hereJohannes Zottele
07/18/2025, 3:07 PMPinned objects in K/N.
1. If I pin an object using the pin() extension function and never unpin() it, will the garbage collector eventually collect it? I found a thread on this channel that suggests that a pinned object remains unchanged and is not moved or freed. However, I’ve written a test program that demonstrates that the callback passed to createCleaner is invoked for both the pinned value object and the Pinned -Object itself.
@OptIn(ExperimentalNativeApi::class, ExperimentalForeignApi::class)
private fun allocate(): Unit {
// create a dummy resource and pin it (but never unpin)
val dummy = Any()
val pinned = dummy.pin()
// setup clean-up callbacks for both, the pinned value and the pinned-object
createCleaner(dummy) {
println("Cleaning up dummy (${markNow()})")
}
createCleaner(pinned) {
println("Cleaning up pinned (${markNow()})")
}
}
@OptIn(NativeRuntimeApi::class)
fun main() {
allocate()
// trigger garbage collection manually
GC.collect()
runBlocking {
// wait 10 secs to see cleaner callbacks
delay(10000)
}
println("Done. (${markNow()})")
}
This outputs
Cleaning up pinned (ValueTimeMark(reading=15083))
Cleaning up dummy (ValueTimeMark(reading=129458))
Done. (ValueTimeMark(reading=10002954250))
So, according to this, the garbage collector actually recognizes both objects, implying that they are being freed. Is that accurate, or are those callbacks triggered even though the underlying object memory remains valid?
2. Assuming pinned is getting collected by the GC, will it unpin() the dummy object automatically?Nikolay Kasyanov
07/29/2025, 2:52 PM@Volatile cannot be applied to local variables, which makes sense historically, but applies to JVM only, what about native?wwalkingg
07/30/2025, 5:51 AMaltavir
08/01/2025, 7:25 AM.konan\dependencies\msys2-mingw-w64-x86_64-2\bin\ld.gold: error: cannot find -lunistring does anybody know how to fix it? For some reason it happens only on some projects.Ghasem Shirdel
08/04/2025, 6:31 AMVishal kumar singhvi
08/05/2025, 8:37 AMDidier Villevalois
08/07/2025, 2:41 PMkotlin-native-prebuilt-2.2.0-linux-aarch64.tar.gz on Maven Central... Is that expected? I encountered that while loading the MCP SDK to make some PRs. I run Fedora Linux (Asahi) on an M1 MBP. I will disable the native targets for now, but that's quite uncomfortable... 😭Raed Ghazal
08/08/2025, 1:17 PMStefan Oltmann
08/17/2025, 6:37 PMAdam S
08/22/2025, 8:42 AM-include-binary KN compiler arg actually do? Does it just tell the compiler to package the files into the my-lib.klib in the /my-lib/default/targets/${targetName}/included/ dir?
Context: I have two .a static library files ( 'debug' and 'release'). I can't see how my subproject my-app can only use the debug my-lib when running runMyAppDebugExecutableMacosArm64 and the release my-lib when running runMyAppReleaseExecutableMacosArm64.
I was thinking about making two variants of my library, one that produces a my-lib-release.klib and another that produces my-lib-debug.klib. The only difference being the included static libs. If I can build the .klib manually, and just update the included files, that'd be a solution (albeit complicated and something I'd prefer to avoid).loke
08/25/2025, 5:30 AM.kt source file.tylerwilson
09/12/2025, 3:27 AMkotlin.native.binary.objcDisposeOnMain = false
kotlin.native.binary.mimallocUseCompaction = true
kotlin.native.toolchain.enabled = false
kotlin.incremental.native = trueIan Botsford
09/15/2025, 4:03 PMld.lld: error: undefined symbol: <name of symbol>. The problem goes away if I specify -lversion as a linker argument.
The specific APIs are GetFileVersionInfoSizeW, GetFileVersionInfoW, and VerQueryValueW, all of which are declared in *winver.h*, which is included in *windows.h*, which is specified as one of the headers bound in the *platform.windows* DEF file.
Why aren't the platform library implementations properly automatically linked by the compiler?Sergey Chelombitko
09/15/2025, 8:35 PMkotlin {
androidNativeArm64 {
compilations.named("main") {
cinterops.register("main") {
compilerOpts("-ID:/Apps/VulkanSDK/Include")
}
}
}
}
I want to use the latest version of Vulkan headers from Vulkan SDK, but the headers from the sysroot path always get the priority:
// This includes Vulkan 1.0 header from $HOME\.konan\dependencies\target-toolchain-2-windows-android_ndk/sysroot/usr/include\vulkan/vulkan.h
#include <vulkan/vulkan.h>Piotr Krzemiński
09/20/2025, 7:29 AMursus
09/20/2025, 12:53 PMxcframework my only option?陈雄
09/22/2025, 12:30 PMOmico
09/24/2025, 3:09 AMHuan
10/06/2025, 2:14 PMloke
10/18/2025, 12:59 PMmemScoped uses nativeHeap, which eventually calls malloc for every allocation. I have a highly performance-intensive function where I need to allocate memory on the stack. Is there a way to get stack allocation instead?loke
10/18/2025, 5:21 PM@CName but when I link the code, I still get a symbol not found error.Vitaliy Zarubin
10/24/2025, 8:49 AMundefined reference to `ac_path_info_get_app_cache'
Here is the result of outputting nm on Linux:
nm libdemo_kmp.a | grep ac_path_info_get_app_cache
00000000000000 T ac_path_info_get_app_cache
U ac_path_info_get_app_cache
nm -A libdemo_kmp.a | grep ac_path_info_get_app_cache
libdemo_kmp.a:ac_path_info.ac_path_info.bb51b92a2c3716b4-cgu.0.rcgu.o:00000000000000 T ac_path_info_get_app_cache
libdemo_kmp.a:libdemo_kmp.a.o: U ac_path_info_get_app_cache
Here is the output of nm on macOS:
nm libdemo_kmp.a | grep ac_path_info_get_app_cache
U ac_path_info_get_app_cache
nm -A libdemo_kmp.a | grep ac_path_info_get_app_cache
libdemo_kmp.a:/private/var/folders/v1/0hmt9k0s2rj_wfvb9kkm43rw0000gn/T/konan_temp8842548127760527663/libdemo_kmp.a.oac_path_info_get_app_cachetylerwilson
10/28/2025, 3:39 AMException in thread "main" org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException: Protocol message tag had invalid wire type.
at org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:99)
at org.jetbrains.kotlin.protobuf.CodedInputStream.skipField(CodedInputStream.java:262)
at org.jetbrains.kotlin.protobuf.GeneratedMessageLite.parseUnknownField(GeneratedMessageLite.java:540)
at org.jetbrains.kotlin.protobuf.GeneratedMessageLite.access$100(GeneratedMessageLite.java:49)
at org.jetbrains.kotlin.protobuf.GeneratedMessageLite$ExtendableMessage.parseUnknownField(GeneratedMessageLite.java:246)
at org.jetbrains.kotlin.metadata.ProtoBuf$PackageFragment.<init>(ProtoBuf.java:28327)
at org.jetbrains.kotlin.metadata.ProtoBuf$PackageFragment.<init>(ProtoBuf.java:28285)
at org.jetbrains.kotlin.metadata.ProtoBuf$PackageFragment$1.parsePartialFrom(ProtoBuf.java:28407)
If I put it back to Kotlin 2.2.20, it works fine. Known issue? I will check the release notes again, perhaps I missed something there.