https://kotlinlang.org
Join Slack
I’m trying to migrate a configuration like: ```plugins { kotlin("multiplatform") id("org.jet...
g

Guilherme Delgado

about 3 years ago
I’m trying to migrate a configuration like:
plugins {
    kotlin("multiplatform")
    id("org.jetbrains.compose") version Versions.JetBrains.Compose.desktop
}
to a convention plugin where:
with(pluginManager) {
  apply("org.jetbrains.kotlin.multiplatform:${catalog.findVersion("kotlin").get()}")
  apply("org.jetbrains.compose:${catalog.findVersion("desktopCompose").get()}")
}
but when I run it throws saying (same for the second line if I comment the first):
Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'org.jetbrains.kotlin.multiplatform:1.7.10' not found.
	at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:144)
I’ve checked here and the syntax of the plugin is correct. What am I missing here? 🤔 Thanks!
g
s
+2
  • 4
  • 26
  • 419
What is `kotlin-js-store`? Recently it is being autogenerated in my projects that target JS
j

Javier

almost 4 years ago
What is
kotlin-js-store
? Recently it is being autogenerated in my projects that target JS
j
h
+3
  • 5
  • 16
  • 419
I want to register an observer to a lifecycleOwner and remove it when this lifecycle is no longer re...
s

Stylianos Gakis

almost 4 years ago
I want to register an observer to a lifecycleOwner and remove it when this lifecycle is no longer resumed. I am currently doing:
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
    launch {
        val callback = LifecycleEventObserver { _: LifecycleOwner, event: Lifecycle.Event ->
            if (event == Lifecycle.Event.ON_PAUSE) {
                // do something on pause
            }
        }
        lifecycleOwner.lifecycle.addObserver(callback)
        try {
            awaitCancellation()
        } finally {
            lifecycleOwner.lifecycle.removeObserver(callback)
        }
    }
}
But this
try/finally
with the
awaitCancellation()
combination feels a bit weird. Is there a nicer way to do this in general?
s
a
n
  • 3
  • 18
  • 419
Whats the recommended way to do Navigation on compose desktop? It seems the official one mentioned i...
s

suresh

about 5 years ago
Whats the recommended way to do Navigation on compose desktop? It seems the official one mentioned in compose doc (https://developer.android.com/jetpack/compose/navigation) is not implemented.
s
s
a
  • 3
  • 5
  • 419
Hello! I have a question regarding back swipe gestures. The sample app lets me swipe back. But my im...
s

Sebastian Schreiber

almost 2 years ago
Hello! I have a question regarding back swipe gestures. The sample app lets me swipe back. But my implementation does not (neither android nor ios). The Back button works as intended. I am wondering if I am missing something?
s
a
  • 2
  • 3
  • 418
Using context receivers for dependency injection, is that a valid use-case? ```interface Blah { ...
j

janvladimirmostert

over 2 years ago
Using context receivers for dependency injection, is that a valid use-case?
interface Blah {
    suspend fun doSomething()
}
class BlahImpl : Blah {

    context(Connection)
    suspend fun doSomething() { ... }

}
currently the above doesn't compile (and the compiler actually just outputs garbage without hinting that this is not allowed - KT-58442) unless you add the context receiver on the
doSomething()
in the interface as well
interface Blah {
    context(connection)
    suspend fun doSomething()
}
which leads to my question, should the interface really know in what context(s) it will be used, doesn't that defeat the purpose of an interface? the actual context in which the implementation runs sounds like implementation detail that now pollutes the interface. maybe the same can be said for suspend, should that really be in the interface too? that being said, if it's not in the interface, then you would be forced to specify at the call-site which implementation you are referring to which would then either require a context or no context or to call it from a coroutineScope or just normally.
j
s
+3
  • 5
  • 7
  • 418
I can’t seem to get autocorrect to work. This is what my detekt.gradle file looks like. Any ideas? `...
v

voben

over 5 years ago
I can’t seem to get autocorrect to work. This is what my detekt.gradle file looks like. Any ideas?
apply plugin: 'io.gitlab.arturbosch.detekt'

detekt {
    parallel = true
    config = files("$rootDir/codeQuality/detekt.yml")
    autoCorrect = true
    reports {
        xml {
            enabled = false
        }
        txt {
            enabled = false
        }
    }
}
v
c
  • 2
  • 14
  • 418
Is there any library in kmp can do convert from byteArray into file? Then this file I will upload us...
h

hafiz

over 1 year ago
Is there any library in kmp can do convert from byteArray into file? Then this file I will upload using ktor client.
h
z
+4
  • 6
  • 25
  • 417
Is it possible to implement Google authentication in kmm and let the ktor-server handle it so that I...
f

Farid Benhaimoud

over 2 years ago
Is it possible to implement Google authentication in kmm and let the ktor-server handle it so that I can use that token to query data from my PostgreSQL database?
f
s
m
  • 3
  • 3
  • 417
hello again, has anyone figured out how to load fonts in compose/canvas?
j

jeran

about 3 years ago
hello again, has anyone figured out how to load fonts in compose/canvas?
j
a
+2
  • 4
  • 26
  • 417
Previous161162163Next

kotlinlang

A modern programming language that makes developers happier.

Powered by