Hi! We are facing a
crash issue with our KMM application targeting
watchOS. The crash occurs when using
Random from the standard library in the shared code, specifically on real Apple Watch devices (Series 9 and Series 4). The issue does not reproduce on the simulator. This crash is present in
Kotlin version 2.0.0, but the code works fine in version 1.9.24. Has anyone else encountered a similar issue and found a solution?
import kotlin.random.Random
fun randomString(): String {
val randomValue = Random.nextInt()
return "$randomValue"
}
The application crashes with
Thread 1: EXC_BAD_ACCESS (code=257, address=0xb8003c).
A detailed stack trace and a sample project are attached in the full ticket on on
YouTrack