https://kotlinlang.org logo
Join SlackCommunities
Powered by
# android
  • t

    thailanrg

    04/17/2025, 8:55 PM
    I need to help with gradle, where I should post my question?
    d
    • 2
    • 3
  • t

    thailanrg

    04/17/2025, 9:01 PM
    Hi guys, I'm getting the following error at runtime build:
    java.util.zip.ZipException: zip END header not found
    . I ran a build scan and this was the result
    not kotlin but kotlin colored 2
    k
    • 2
    • 10
  • s

    Slackbot

    04/18/2025, 8:13 AM
    This message was deleted.
    🚫 1
    j
    • 2
    • 1
  • a

    Andi

    04/18/2025, 9:24 AM
    👋 Hello, team!
    not kotlin but kotlin colored 3
    🚫 2
  • p

    Poonam

    04/18/2025, 9:38 AM
    Hello team, I am stuck with an issue, hope to find it's solution here. where on clicking applink user gets redirected to desire page of our application..but after back press app goes to background and on opening app from background it's again redirects to last page where it got redirected via applink. Tried clearing intent but it's not helpful it's a compose an application.. splash activity receives applink data in intent.data.geturl and then after parsing data it passes data to home activity and in home activity navigation controller is there it navigates to second bottom navigation tab and Backpress from there it navigates to first tab then backpress from there it finishes home activity(app requirement ) and app goes in background. And then opening app from background (home activity oncreate gets called with saved bundle null but intent extra with link) .. it lands on last applink redirected page again.
    not kotlin but kotlin colored 1
    c
    • 2
    • 1
  • s

    Slackbot

    04/18/2025, 11:14 AM
    This message was deleted.
    h
    • 2
    • 1
  • n

    Nitesh Singh

    04/19/2025, 12:36 PM
    how i will display all adapter in one fragment this Ui only . i have 4 column how i will display 4 xml layout with adpter item
    not kotlin but kotlin colored 3
    c
    • 2
    • 1
  • v

    Vivek Modi

    04/19/2025, 12:47 PM
    I'm working on a multi-module Android project and created a convention plugin to automatically generate namespaces based on the module path. The idea is to avoid manually setting the namespace in each
    build.gradle.kts
    file.
    not kotlin but kotlin colored 2
    c
    • 2
    • 6
  • n

    Nitesh Singh

    04/20/2025, 9:04 AM
    i am give margin top = 10dp and bottom = 10dp but margin is not effect between two item . i am using adapter . i am giving margin in recylerview xml layout . could you help me how i will give margin between two item
    not kotlin but kotlin colored 3
    c
    m
    • 3
    • 7
  • h

    Harjot Singh

    04/22/2025, 1:56 PM
    Given that these are different fragments, the first one with composables; how do I go about implementing this transition?
    Screen Recording 2025-04-22 at 7.21.40 PM.mov
    not kotlin but kotlin colored 2
    c
    h
    • 3
    • 2
  • b

    buszi0809

    04/22/2025, 8:18 PM
    Just released a small library I've been working on: Boomerang – a lightweight solution for passing navigation results between screens in Jetpack Compose and AndroidX Fragment apps. For now it supports only Android platform, but I'm planning to make it multiplatform after wider adoption and feedback. If you’ve ever found yourself fighting with tightly coupled navigation flows or trying to pass data back from one screen to another in Compose (without a mess of callbacks, shared ViewModels or weirdly accessing the saved state of previous screen), Boomerang might be just for you. It’s inspired by the
    setFragmentResultListener
    pattern, but is designed to be modular, minimal, and easy to drop into both Compose and Fragment projects—no matter what navigation library you use. A few things I focused on: • Decoupling producers and consumers of navigation results • Preserving results across configuration changes and process death • Supporting mixed projects (Compose + Fragments) • Keeping dependencies minimal There’s a sample app in the repo showing both Compose and Fragment usage. Feedback, bug reports, and feature requests are all welcome! (via Github Issues) Repo: https://github.com/buszi/Boomerang
    🙌 3
    c
    • 2
    • 3
  • n

    neuber

    04/23/2025, 9:16 PM
    Can anyone help-me: https://github.com/FirebaseExtended/firebase-video-samples/issues/105
    c
    m
    • 3
    • 9
  • m

    mattinger

    04/24/2025, 1:40 PM
    So i'm having a bit of trouble with ModalBottomSheet. It seems that • The dialog itself can be full edge to edge, instead of the scrim occupying the portion that would overlap with the system status bars • The default drag handle does not accomodate the system status bars padding. • The content does not accomodate the navigation bars padding. I can add my own drag handle (even if i call the default one) and having it move down by using the .statusBarsPadding modifier so that it's actually visible and actionable, but i would have expected the ModalBottomSheet function to have some of this accounted for already. And on top of that, it gets applied even if the bottom sheet isn't tall enough to cover the system status bars, so i end up with a lot of extra space at the top of the drag handle.
    Copy code
    @OptIn(ExperimentalMaterial3Api::class)
    @Composable
    @Preview
    fun ModalBottomSheetPreview() {
        ModalBottomSheet(
            sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
            onDismissRequest = {}
        ) {
            Column(modifier = Modifier.verticalScroll(rememberScrollState())){
                (0..100).forEach {
                    Text(text = "Text${it}")
                }
    
            }
    
        }
    }
    • 1
    • 2
  • t

    thailanrg

    04/28/2025, 5:21 PM
    I have a doubt: About namespace after update gradlew
    not kotlin but kotlin colored 6
    e
    c
    • 3
    • 3
  • s

    Slackbot

    04/30/2025, 1:48 PM
    This message was deleted.
    not kotlin but kotlin colored 3
    n
    • 2
    • 1
  • e

    Edric Chan

    05/02/2025, 7:41 AM
    So it seems that Kotlin 2.2.0-Beta2 still generates the old
    kotlinOptions
    extension on AGP's extension DSLs, as I'm now getting a compile-time error regarding
    KotlinJvmOptions
    when attempting to sync my project:
    e: file///<project>/buildSrc/build/generated sources/kotlin dsl accessors/kotlin/gradle/kotlin/dsl/accessors/ 90f4d750eb0eb7c178e5c9286b37eba5/Accessorsddyeb7w41u46k0luktll7npb.kt65:96 Using 'KotlinJvmOptions' is an error. Please migrate to the compilerOptions DSL. More details are here: https://kotl.in/u1r8ln
    which links to
    Copy code
    /**
     * Retrieves the [kotlinOptions][org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions] extension.
     */
    internal
    val com.android.build.gradle.LibraryExtension.`kotlinOptions`: org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions get() =
        (this as org.gradle.api.plugins.ExtensionAware).extensions.getByName("kotlinOptions") as org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
    
    /**
     * Configures the [kotlinOptions][org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions] extension.
     */
    internal
    fun com.android.build.gradle.LibraryExtension.`kotlinOptions`(configure: Action<org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions>): Unit =
        (this as org.gradle.api.plugins.ExtensionAware).extensions.configure("kotlinOptions", configure)
    👍 3
    • 1
    • 2
  • n

    Nitish

    05/05/2025, 9:21 AM
    👋 Hello, team!
    u
    • 2
    • 1
  • a

    Asadullah Nadeem

    05/05/2025, 9:28 AM
    Hello
    u
    • 2
    • 1
  • u

    Usman

    05/06/2025, 5:03 AM
    Anyone have quality discord server I want to join and talk on topics
    not kotlin but kotlin colored 4
    c
    • 2
    • 3
  • u

    Usman

    05/06/2025, 6:12 AM
    Hello friends! I have solid experience in Android Jetpack SDK, Kotlin Multiplatform (KMP), Compose Multiplatform, and iOS development using SwiftUI. I'm also skilled in API development using Python Flask or Ktor server, and I can handle both SQL and NoSQL databases. I'm comfortable working with: Supabase Firebase PythonAnywhere PostgreSQL The main point is—if there's anyone else at a similar level who still doesn’t have a job or freelancing project, feel free to connect with me. Let’s talk and figure out why we’re not getting hired or paid.
    not kotlin but kotlin colored 8
    d
    • 2
    • 1
  • d

    dead.fish

    05/07/2025, 7:22 AM
    Interesting, the shorthand
    when (someSealedThing) { SomeOption -> Unit; SomeOtherOption -> { ... } }
    is used, Kotlin 2.1.20 now reports for
    SomeOption -> Unit
    the warning "Expression is unused". If I change this to
    SomeOption -> { }
    it's all fine.
    🙁 1
  • t

    Timz Owen

    05/07/2025, 8:05 PM
    is there a way to bundle android and ios sdk for doing kyc in KMM if the platform only offers separate sdks ? and not one ?
    c
    • 2
    • 1
  • y

    Yusuf Ibragimov

    05/08/2025, 6:44 AM
    Hello everyone, I have on question about Android device unique id, Android ID is not working after Android version >=26. We cann't find another way to get device unique id.
    not kotlin but kotlin colored 2
    n
    c
    • 3
    • 2
  • h

    Hinaka

    05/08/2025, 10:05 AM
    Hey everyone, has anyone run into issues with Safe Args in Android Studio? The
    FragmentArgs
    classes are generated correctly and the project builds and runs fine, but Android Studio still shows them as unresolved (red). It's pretty annoying since there's no autocomplete or type reference support in the IDE. Anyone found a fix for this?
    not kotlin but kotlin colored 2
    c
    • 2
    • 1
  • j

    Jose Monteiro

    05/09/2025, 9:17 AM
    Hello everyone, I have ran into a change of behaviour starting with kotlin 2.1.20. We have our own flavour of the ASOP that we also use to build the SDK "android.jar" that we use with
    compileOnly
    in our application, to get access to some `@SystemApi`s or
    @hide
    , however starting with 2.1.20 classes that are hidden are still working but
    @SystemApi
    methods no longer resolve. I managed to get around it by setting the library manually in the
    KotlinCompile
    task like so
    tasks.withType(KotlinCompile::class.java) { libraries.setFrom("pathToLib") }
    . We could have also stripped the
    @SystemApi
    annotation from the sources but we didn't want to rebuild it and have to maintain all those changes. Is anyone aware that this change was intensional? simply making the compile stricter in relation to its dependencies?
  • a

    Andi

    05/11/2025, 7:14 AM
    Hi guys, is there anyone who needs help with a small project or side project? I'm looking to gain more experience, so if there's a project I can help with (free/volunteer)
    not kotlin but kotlin colored 3
    c
    • 2
    • 1
  • m

    Mohammad Zaki

    05/11/2025, 9:47 AM
    Hi Team, I am trying to implement web socket through ktor server . Its working fine but its not connecting to android app which is using ktor client. I am getting this error : <ws://ip-here8080/clipboard/myRoom> Operation not permitted
    c
    • 2
    • 1
  • u

    0xf1f1

    05/11/2025, 3:06 PM
    When working with
    sealed interface/sealed class
    and using
    copy()
    , how does one create common functions that are shared by all the inheriting data classes without repeating the code ? See
    changeFooVal()
    below. The function performs the exact same operation for all data classes which makes it repetitive + more lines/maintenance overhead.
    sealed interface Foo {
    val fooVal: String
    data class FooX(val fooVal: String) {
    fun changeFooVal(value: String): FooX = copy(fooVal = value)
    }
    data class FooY(val fooVal: String) {
    fun changeFooVal(value: String): FooY = copy(fooVal = value)
    }
    }
    c
    • 2
    • 1
  • p

    Pablo

    05/12/2025, 11:40 AM
    I have a question about Glance widgets. Google recommends to use CoroutineWorker to update our new Glance widgets, I suposse that using a periodic work started in Application when the app is started for the first time, for example, because now, widgets doesn't have onEnabled() method, that in oldschool widgets was used to start periodic threads for updating them. So I see a problem here. If the user has not placed any widget on the desktop, why should we have to start a periodic worker constantly updating? Do google offers a solution for this? I don't find it. EDIT: moved to #C032SRZRD7Z channel
    not kotlin but kotlin colored 1
    c
    • 2
    • 1
  • r

    reactormonk

    05/12/2025, 6:31 PM
    I'm trying to get
    @Parcelize
    to generate me the
    CREATOR
    for this class:
    Copy code
    interface Ringing {
        val token: String
        val other: Uuid
    }
    interface NoCall
    
    @Parcelize
    sealed class JCallState: Parcelable {
        data class IncomingRing(val caller: Uuid, override val token: String) : Ringing, JCallState() {
            override val other: Uuid
                get() = caller
        }
        data class OutgoingRing(val callee: Uuid, override val token: String) : Ringing, JCallState() {
            override val other: Uuid
                get() = callee
        }
        data class Connecting(val callee: Uuid) : JCallState()
        data class InCall(val other: Uuid, val token: String) : JCallState()
        data class Rejected(val other: Uuid) : NoCall, JCallState()
        data class HungUp(val x: String = "foo") : NoCall, JCallState()
    }
    But when trying to use it in aidl via
    Copy code
    parcelable JCallState;
    It tells me there is no
    CREATOR
    .
    c
    • 2
    • 5