https://kotlinlang.org
Join Slack
Edit: Solved After updating to Kotlin 1.9.20 I get the following error: ```Plugin [id: 'org.jetbra...
e

eygraber

over 1 year ago
Edit: Solved After updating to Kotlin 1.9.20 I get the following error:
Plugin [id: 'org.jetbrains.kotlin.kapt'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
It was working fine before like this:
plugins {
  kotlin("kapt")
}
It seems to work if I manually add the version:
plugins {
  kotlin("kapt") version "1.9.20"
}
e
t
  • 2
  • 2
  • 659
Is KSP still not compatible with Kotlin 2.0.0?
s

Suresh Maidaragi

about 1 year ago
Is KSP still not compatible with Kotlin 2.0.0?
s
r
e
  • 3
  • 10
  • 658
I’m getting bunch of weird looking crashes when I use `ComposeView` within my application. I’ve dug ...
j

Jakub Wiśniewski

almost 3 years ago
I’m getting bunch of weird looking crashes when I use
ComposeView
within my application. I’ve dug trough all the sources and still cannot find the cause od the problem. TLDR version of it is that I have a list with error view on top of it that contains “refresh” button. Clicking it with my internet off (so that the view will appear) makes my app crash with bunch of compose related logs that do not point in any direction such as:
java.lang.ArrayIndexOutOfBoundsException: length=3; index=3 -> ViewGroup
java.lang.IllegalArgumentException: Failed requirement -> androidx.compose.ui.node.MeasureAndLayoutDelegate
java.lang.IllegalArgumentException: Failed requirement -> androidx.compose.ui.platform.AndroidComposeView.notifyLayerIsDirty
java.lang.IllegalStateException: Underflow in restore - more restores than saves

Exception Type: Unknown (SIGSEGV)
What is important to mention is that it only happens on RELEASE version of the App. I’ve dissected my app and trying to reproduce the issue on fresh repo but I wasn’t able to, yet. No such problems when I switch to
ComponentActivity
instead of
Fragment
with
ComposeView
as its only view. I don’t have unusual amount of recompositions either - around 2 for state. Would appreciate any kind of help, guidance, ideas what might be the source of my problem.
j
z
+2
  • 4
  • 39
  • 658
Trying to serialize generic data class having with default value produces empty JSON object `{}` Ea...
d

Danish Ansari

almost 4 years ago
Trying to serialize generic data class having with default value produces empty JSON object
{}
Easiest way to reproduce this issue is to try official generic classes example, add
data
modifier to the class and have default value (eg. in thread) https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md#generic-classes I'm using kotlinx.serialization v1.2.2 and Kotlin v1.5.21 Update: All I had to do was read this section of doc 😅https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/json.md#encoding-defaults
d
e
  • 2
  • 2
  • 657
Hi how to change Checkbox rounded corner for Box, after check the code i think it is impossible. Rad...
m

Marcin Mazurek

about 4 years ago
Hi how to change Checkbox rounded corner for Box, after check the code i think it is impossible. Radius should be changeable from the outside
@Composable
private fun CheckboxImpl(
    enabled: Boolean,
    value: ToggleableState,
    modifier: Modifier,
    colors: CheckboxColors
) {
....
        drawBox(
            boxColor = boxColor,
            borderColor = borderColor,
            radius = RadiusSize.toPx(),
            strokeWidth = strokeWidthPx
        )
➕ 1
m
k
+2
  • 4
  • 10
  • 657
I have a multiplatform project: Android and Desktop. I have defined the core coroutine package in `c...
d

Daniele B

over 2 years ago
I have a multiplatform project: Android and Desktop. I have defined the core coroutine package in `commonMain`:
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
on Android, the app works without the need of adding the android-specific coroutine package on
androinMain
on Desktop, it gives me this error:
Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlin-coroutine-android' and ensure it has the same version as 'kotlin-coroutine-core'
what is the reason why on Android, the target specific package is not needed?
d
a
f
  • 3
  • 3
  • 656
Is having janky frames normal with Jetpack Compose? I build two test apps, one in Compose and one in...
a

Aaron Waller

almost 3 years ago
Is having janky frames normal with Jetpack Compose? I build two test apps, one in Compose and one in XML with a TabLayout + HorizontalPager and a GridView with 3 Columns. I recorded the stacktrace of both apps and uploaded it to Perfetto. The one with many janky frames is jetpack compose. The lags appear while swiping through the HorizontalPager, scrolling through the LazyVerticalGrid is working fine. I think I either have to stop using HorizontalPager + LazyVerticalGrid or switch back to XML. Any ideas what could cause this many janky frames? Code is in Thread ->
a
r
+2
  • 4
  • 23
  • 656
How can I dismiss a `DropdownMenu` when it is clicked? Is the only way through `DropdownMenuItem` vi...
c

Chris Fillmore

almost 3 years ago
How can I dismiss a
DropdownMenu
when it is clicked? Is the only way through
DropdownMenuItem
via its
onClick
? I’ve tried passing
DropdownMenu(modifier = Modifier.clickable …)
but this doesn’t have any effect that I can see.
c
a
  • 2
  • 8
  • 655
I am using material navigation and bottomSheet composable in navGraph. Everything working ok so far,...
p

Piotr Prus

almost 3 years ago
I am using material navigation and bottomSheet composable in navGraph. Everything working ok so far, except one thing. The bottomSheet automatically closes when I navigate to another destination. I would like to keep it open (remember its state) when coming back to the screen with bottomSheet. Video and code in the 🧵 👇
p
c
j
  • 3
  • 13
  • 655
Hi I am trying to get security resource server working with Spring 3 and Kotlin and it’s proving dif...
o

Olufemi Adeojo

almost 2 years ago
Hi I am trying to get security resource server working with Spring 3 and Kotlin and it’s proving difficult.
@Configuration
class SecurityConfig {

    @Bean
    fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
        http
            .csrf { obj: CsrfConfigurer<HttpSecurity> -> obj.disable() }
            .oauth2ResourceServer { oauth2: OAuth2ResourceServerConfigurer<HttpSecurity?> ->
                oauth2.jwt(
                    Customizer.withDefaults()
                )
            }
        return http.build()
    }
}
o
k
  • 2
  • 5
  • 654
Previous777879Next

kotlinlang

A modern programming language that makes developers happier.

Powered by