https://kotlinlang.org
Join Slack
How do you guys handle errors in KMM? For example, I have this use case ```interface SignInUseCase ...
i

Igor Milakovic

over 3 years ago
How do you guys handle errors in KMM? For example, I have this use case
interface SignInUseCase {
    @Throws(Exception::class)
    suspend fun execute(email: String, password: String): Whatever
}
When I call this from iOS, I get
signInUseCase.execute(email: email, password: password) { whatever, error in
    // Handle completion
}
Is there a way to have a custom error here, instead of NSError? Ideally, I'd like to have maybe a class or data class
data class Error(
    val title: String
    val detail: String
}
i
t
g
  • 3
  • 28
  • 1387
How to make one item in LazyVerticalGrid fill all the parent width ? Scenario: LazyVerticalGrid wit...
a

Akram Bensalem

over 3 years ago
How to make one item in LazyVerticalGrid fill all the parent width ? Scenario: LazyVerticalGrid with diffrent Lists every list should have it own header How I can implement the header to take all the width ?
a
o
c
  • 3
  • 4
  • 1385
Is there a way to schedule a task in ktor? I want to sechedule a task for 20 minutes if they are ove...
i

IsaacMart

almost 3 years ago
Is there a way to schedule a task in ktor? I want to sechedule a task for 20 minutes if they are over, that task should be marked expired. Am having idea of using delay but not sure if its tye best approach so far.Any one please?
i
r
+3
  • 5
  • 20
  • 1381
Does anyone know why the Kotlin compiler does not work with JDK 20, even with the Maven extension in...
g

Gavin Ray

almost 3 years ago
Does anyone know why the Kotlin compiler does not work with JDK 20, even with the Maven extension instead of Gradle? 🤔
g
s
  • 2
  • 4
  • 1380
I always get this error: `The Hilt Android Gradle plugin is applied but no com.google.dagger:hilt-an...
a

Akram Bensalem

over 4 years ago
I always get this error:
The Hilt Android Gradle plugin is applied but no com.google.dagger:hilt-android dependency was found.
I wan't to use Hilt with Jetpack Compose but always I got this error
a
s
f
  • 3
  • 32
  • 1375
My multiplatform backend project stopped compiling for the MacOS targets. Fails with ```e: Could not...
r

ribesg

almost 3 years ago
My multiplatform backend project stopped compiling for the MacOS targets. Fails with
e: Could not find "org.jetbrains.kotlin.native.platform.CoreFoundationBase" in [/Users/ribesg/Projects/Inboxbooster-Mailer/HttpReceiver, /Users/ribesg/.konan/klib, /Users/ribesg/.konan/kotlin-native-prebuilt-macos-aarch64-1.7.22/klib/common, /Users/ribesg/.konan/kotlin-native-prebuilt-macos-aarch64-1.7.22/klib/platform/macos_arm64]
during
compileKotlinMacosArm64
and
compileKotlinMacosX64
. It worked before, it appeared when I added a dependency on
com.squareup.okio:okio:3.3.0
, but the problem is that I don't understand the error. It's open source so you can try for yourself here https://github.com/wizbii/Inboxbooster-Mailer/tree/feature/kotlin-receiver/HttpReceiver ✅ Was caused by Okio 3.3.0 being built for Kotlin 1.8 while I am using 1.7.22.
r
  • 1
  • 2
  • 1373
Hey, everyone What should I “git ignore” in a kmm project? is there a .gitignore template for it?
h

henrikhorbovyi

over 3 years ago
Hey, everyone What should I “git ignore” in a kmm project? is there a .gitignore template for it?
➕ 1
h
l
m
  • 3
  • 7
  • 1370
Is there any way to set min window size?
a

Akram Bensalem

about 4 years ago
Is there any way to set min window size?
a
s
  • 2
  • 3
  • 1366
i keep getting "The 'java' plugin has been applied, but it is not compatible with the Android plugin...
y

Yousef

over 3 years ago
i keep getting "The 'java' plugin has been applied, but it is not compatible with the Android plugins."
y
e
+2
  • 4
  • 15
  • 1365
We (still) use slf4j/logback in our Kotlin code. Currently, we define a `val logger: Logger = Logger...
n

nkiesel

over 4 years ago
We (still) use slf4j/logback in our Kotlin code. Currently, we define a
val logger: Logger = LoggerFactory.getLogger(Foo::class.java)
in the companion object of a class
Foo
. I remember a discussion about defining this as a class property instead of as a companion object property (which would then allow to use
val logger: Logger = LoggerFactory.getLogger(this::class.java)
) but I can't find it anymore. What is current best practice here ?
n
n
+4
  • 6
  • 61
  • 1365
Previous222324Next

kotlinlang

A modern programming language that makes developers happier.

Powered by