https://kotlinlang.org
Join Slack
Can compose infer stability of a `sealed` class ? ```sealed class MyClass { object A : MyClass()...
r

ritesh

over 3 years ago
Can compose infer stability of a
sealed
class ?
sealed class MyClass {
  object A :  MyClass()
  data class SomeClass(val value:String): MyClass()
}
r
g
+2
  • 4
  • 28
  • 1746
Hi, debugging the iOS platform on KMP is proving to be a bit complicated. I am not sure if I am doin...
j

Jose Garcia

about 3 years ago
Hi, debugging the iOS platform on KMP is proving to be a bit complicated. I am not sure if I am doing something wrong, but is it not possible to inspect variables or evaluate expressions using the intelliJ debugger? I can set the breakpoints fine but when it comes to seeing the snapshot of my objects I don’t get any output, just errors.
j
k
+3
  • 5
  • 63
  • 1745
Hey I am not able to use String.format in Shared module that is powered by KMM. Does anyone has any ...
h

Harsh Joshi

over 2 years ago
Hey I am not able to use String.format in Shared module that is powered by KMM. Does anyone has any clue?
h
v
+2
  • 4
  • 5
  • 1744
is there is a multiplatform library for URL Encoding with parameter?
i

itnoles

over 2 years ago
is there is a multiplatform library for URL Encoding with parameter?
➕ 1
i
k
+2
  • 4
  • 4
  • 1742
Hey ! I want to ask people around if `runCatching` is in use in any of your Kotlin (or Android) pro...
n

Nino

over 2 years ago
Hey ! I want to ask people around if
runCatching
is in use in any of your Kotlin (or Android) projects ? I feel my team is abusing it and I'm trying to understand if there's any "pros" about using it in any coroutine-based codebase. My team just adopted this convention and I'm at loss of words. (Examples in thread for anyone interested)
n
j
+6
  • 8
  • 107
  • 1729
hi there, I'm trying to run an UI test in shared/commonTest and facing the following NPE. This tests...
k

Kathrin

over 1 year ago
hi there, I'm trying to run an UI test in shared/commonTest and facing the following NPE. This tests works fine when I run it in androidInstrumentedTest. Any ideas?
java.lang.NullPointerException: Cannot invoke "String.toLowerCase(java.util.Locale)" because "android.os.Build.FINGERPRINT" is null
	at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.runTest(ComposeUiTest.android.kt:314)
	at androidx.compose.ui.test.ComposeUiTest_androidKt.runAndroidComposeUiTest(ComposeUiTest.android.kt:114)
	at androidx.compose.ui.test.ComposeUiTest_androidKt.runComposeUiTest(ComposeUiTest.android.kt:61)
	at androidx.compose.ui.test.ComposeUiTest_androidKt.runComposeUiTest$default(ComposeUiTest.android.kt:60)
k
a
+3
  • 5
  • 17
  • 1728
Hi folks. I want to upload a huge multipart file to my server via Ktor Client. Any ideas or tips? Th...
m

Mikhail

over 3 years ago
Hi folks. I want to upload a huge multipart file to my server via Ktor Client. Any ideas or tips? The file is considered to be larger than 2GB.
m
f
+3
  • 5
  • 12
  • 1727
Hello, Seeing `w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.` in lo...
b

Berkeli Alashov

over 1 year ago
Hello, Seeing
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.
in logs means it applies only for kapt right? i.e rest of the project is using kotlin 2.0, but kapt itself is falling back kotlin 1.9? Context: we have upgraded most of our modules to use kotlin 2.0 & ksp, but only 2 modules are using
id("kotlin-kapt")
(because of room-java) I'm guessing we will still be able to use kotlin 2.0 in those modules using kotlin-kapt, right?
👌 2
b
d
  • 2
  • 1
  • 1713
How do we configure serialization now with Ktor 2.0 on an Android client? This example for previous...
n

Nathan Kleinschmidt

over 3 years ago
How do we configure serialization now with Ktor 2.0 on an Android client? This example for previous versions is deprecated and no longer works:
client = HttpClient(Android) {
    install(JsonFeature) {
      serializer = KotlinxSerializer()
    }
}
The migration guide says to use the content negotiation plugin, but there are no examples of how to do this on Android that I can see.
n
d
+3
  • 5
  • 11
  • 1708
Hi, how can I convert a Swift `NSData` to Kotlin `ByteArray`? Background: I’m working on a Kmp libra...
b

Bao Le Duc

almost 3 years ago
Hi, how can I convert a Swift
NSData
to Kotlin
ByteArray
? Background: I’m working on a Kmp library where we need to use OS’s crypto API to encrypt data. So, in Kmp library we define an Interface
interface MessagePackHelper {
    fun serialize(payload: String): ByteArray
}
from iOS, we need to implement this interface and set back to the Kmp library. So in Swift, we need to implement below method:
func serialize(payload: String) -> KotlinByteArray {
        // let encyrpted = encrypt(payload) // result is NSData obect
        // todo - would like to convert NSData -> KotlinByteArray
    }
b
e
  • 2
  • 5
  • 1705
Previous151617Next

kotlinlang

A modern programming language that makes developers happier.

Powered by