https://kotlinlang.org
Join Slack
How to get the screen size when in edge-to-edge mode? I just figured out that LocalContext.current.r...
t

Timo Drick

almost 2 years ago
How to get the screen size when in edge-to-edge mode? I just figured out that LocalContext.current.resources.displayMetrics only returns widht and height excluding insets And also: LocalConfiguration.current.screenWidthDp do not include the insets.
t
a
+4
  • 6
  • 40
  • 2012
How can I collect a flow in swift using KMM?
h

Hossein Amini

over 4 years ago
How can I collect a flow in swift using KMM?
h
m
+2
  • 4
  • 4
  • 1995
what does this error means? ```Reading a state that was created after the snapshot was taken or in a...
m

Marko Novakovic

almost 5 years ago
what does this error means?
Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied
m
c
c
  • 3
  • 7
  • 1995
Hey guys, what the meaning of this error `kotlinx.serialization compiler plugin is not applied to t...
v

Vivek Modi

over 3 years ago
Hey guys, what the meaning of this error
kotlinx.serialization compiler plugin is not applied to the module, so this annotation would not be processed. Make sure that you've setup your buildscript correctly and re-import project.
v
m
+2
  • 4
  • 11
  • 1989
I have a problem with window insets (being always 0). Nothing works, neither `WindowInsets.navigatio...
s

Simon Hardt

almost 3 years ago
I have a problem with window insets (being always 0). Nothing works, neither
WindowInsets.navigationBars.getBottom(LocalDensity.current)
nor the
navigationBarsPadding()
-modifier. This occurs when I have composable inside a
ComposeView
which itself is inside an
AndroidView
. Maybe this double injection screws up the insets? This is used as a way to show a
Fragment
inside an
Activity
which only uses
ComponentActivity.setContent()
to get into compose and everything else is handled inside compose only (e.g. navigating to different screens and some of those are simple composables but some are legacy fragments)
s
s
+3
  • 5
  • 6
  • 1988
I am having trouble getting Kotlin language server to work within a fresh ubuntu machine install on ...
r

Ray Rahke

almost 2 years ago
I am having trouble getting Kotlin language server to work within a fresh ubuntu machine install on VSCode. 1. I create a new codespace on github (this is just an ubuntu vm) 2. I create a
main.kt
file with a simple hello world print. There is no boilerplate or folder structure, just
project/main.kt
3. I install
Kotlin
extension by fwcd. I receive the output error
... 3 more
Caused by: org.javacs.kt.util.KotlinLSException: No repositories found at $MAVEN_REPOSITORY, $MAVEN_HOME, $M2_HOME or $HOME/.m2
	at org.javacs.kt.classpath.HomeKt.<clinit>(Home.kt:22)
	... 21 more

[Error - 8:01:49 PM] Kotlin Language Client client: couldn't create connection to server.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.ExceptionInInitializerError
This does not happen on my actual machine, where all the intellisense just works after installing the extension. I assume I am missing something I need to download, but can't figure out what. On previous attempts I tried installing kotlinc and openjdk-18, but neither fixed the issue, unless I did not configure them correctly. Can someone please tell me what dependencies are required to get this to work assuming a totally fresh system with no java/kotlin/intellij stuff installed previously?
r
c
j
  • 3
  • 4
  • 1986
Hi all. Using KotlinX, how do I serialize or desarialize a generic attribute? ```@Serializable data ...
r

Rodrigo Silva

almost 3 years ago
Hi all. Using KotlinX, how do I serialize or desarialize a generic attribute?
@Serializable
data class Test<T>(
val attr: T
)
r
a
  • 2
  • 10
  • 1950
What's the proper way to pass the `-Xexpect-actual-classes` flag to the compiler in 1.9.20-RC? Previ...
j

Jeff Lockhart

about 2 years ago
What's the proper way to pass the
-Xexpect-actual-classes
flag to the compiler in 1.9.20-RC? Previously in 1.9.20-Beta2 I had:
kotlin {
    compilerOptions {
        freeCompilerArgs.add("-Xexpect-actual-classes")
    }
}
But this top-level
compilerOptions
has been removed now. I've tried
tasks.withType<KotlinCompile>().configureEach {
    compilerOptions {
        freeCompilerArgs.add("-Xexpect-actual-classes")
    }
}
and
tasks.withType<KotlinCompile>().configureEach {
    kotlinOptions {
        freeCompilerArgs += "-Xexpect-actual-classes"
    }
}
but still get the warning
'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. You can use -Xexpect-actual-classes flag to suppress this warning. Also see: https://youtrack.jetbrains.com/issue/KT-61573
during compilation.
youtrack 1
j
a
+3
  • 5
  • 13
  • 1929
Hey, I am using `NavigationBarItem` with Material 3 in jetpack compose project. I don’t want to have...
a

Adeel Malik

almost 3 years ago
Hey, I am using
NavigationBarItem
with Material 3 in jetpack compose project. I don’t want to have this box-like effect when nav item is selected. What is this called and how do i go about removing it? 🙏
a
s
+3
  • 5
  • 8
  • 1920
Hi, how do I pass environment variables in a Gradle Configuration that runs the `:run` task to the K...
a

Ayfri

over 2 years ago
Hi, how do I pass environment variables in a Gradle Configuration that runs the
:run
task to the Kotlin project of this task ?
a
j
+2
  • 4
  • 21
  • 1908
Previous111213Next

kotlinlang

A modern programming language that makes developers happier.

Powered by