https://kotlinlang.org logo
Join SlackCommunities
Powered by
# gradle
  • s

    Suhas

    04/07/2025, 5:03 PM
    hello anyone here who can help me with gradle plugin publishing i want to publish it locally and test it then publish it this is for gsoc anyone who can help me please
    not kotlin but kotlin colored 1
    c
    o
    • 3
    • 10
  • o

    Oleg Nenashev

    04/08/2025, 7:56 AM
    set the channel topic: This channel is for Kotlin specific Gradle questions. For general Gradle questions, join the Gradle Community Slack → https://slack.gradle.org/
  • o

    Oleg Nenashev

    04/08/2025, 7:56 AM
    set the channel topic: This channel is for Kotlin specific Gradle questions. For general Gradle questions, join the Gradle Community Slack → https://slack.gradle.org/
  • r

    Rohit Verma

    04/08/2025, 12:16 PM
    Hey everyone, I am working on kmp project and want to create a custom gradle convention plugin for setting up compose multiplatform UI testing. But I don't know how to add below dependencies because we cannot directly reference the
    compose.uiTest
    or
    compose.desktop.currentOs
    . Any ideas how to do that??
    Copy code
    commonTest.dependencies {
                @OptIn(ExperimentalComposeLibrary::class)
                implementation(compose.uiTest)
            }
    
            desktopTest.dependencies {
                implementation(compose.desktop.currentOs)
            }
    v
    e
    p
    • 4
    • 19
  • n

    Nitesh Singh

    04/10/2025, 9:34 AM
    hey there, how i will send data two time morning and evening to the server by workmanager that could you explain me ?
    v
    • 2
    • 2
  • b

    Ben Dowden

    04/13/2025, 6:50 PM
    I have a dependency on a file-based jar
    implementation(files("libs/slf4j-android-1.6.1-rc1.jar"))
    that I want to exclude from
    configuration.testImplementation { exclude("org.slf4j"}
    but it doesn't seem to work. mockk is complaining that
    Log.i
    isn't a mock object
    v
    • 2
    • 1
  • p

    prudhvi reddy

    04/14/2025, 7:11 AM
    👋 Hey all i've noticed this cool feature `TYPESAFE_PROJECT_ACCESSORS`which is in experimental from Gradle 7.0 Are there any downsides in enabling this? Is team considering to move this feature to stable sometime?
    h
    t
    +5
    • 8
    • 12
  • v

    Vivek Modi

    04/15/2025, 6:28 PM
    I'm working on a custom Gradle setup using Kotlin DSL, and while exploring the nowinandroid project—specifically the convention/build.gradle.kts and libs.versions.toml files—I noticed an inconsistency in how plugin IDs are accessed from the
    libs.versions.toml
    version catalog in the
    build-logic:convention
    module.
    e
    • 2
    • 6
  • u

    Umesh Solanki

    04/16/2025, 8:19 AM
    I'm using kotlin 2.1.20 and gradle 8.10, getting this error, have any idea how to resolve this?
    Copy code
    plugins -> kotlin("multiplatform") version "2.1.20"
    kotlin {
    
        jvm {
            binaries {
                executable {
    
                }
            }
        }
        js(IR) {
            binaries.executable()
            browser {
                commonWebpackConfig {}
            }
        }
    .....
    e: 'java' Gradle plugin is not compatible with 'org.jetbrains.kotlin.multiplatform' plugin. Consider adding a new subproject with 'java' plugin where the KMP project is added as a dependency. e: 'application' (also applies 'java' plugin) Gradle plugin is not compatible with 'org.jetbrains.kotlin.multiplatform' plugin. Consider the new KMP/JVM binaries DSL as a replacement: https://kotl.in/jvm-binaries-dsl
    v
    t
    b
    • 4
    • 9
  • m

    mbonnin

    04/18/2025, 4:21 PM
    Sharing for visibility. Any thoughts about renaming this channel to
    #kotlin-gradle-plugin
    ? https://kotlinlang.slack.com/archives/C0B8W32VA/p1744993229858679
    👌 7
  • s

    Slackbot

    04/19/2025, 12:29 PM
    This message was deleted.
    v
    • 2
    • 1
  • p

    PHondogo

    04/21/2025, 8:23 PM
    Calling for help. While building project got compilation warning
    Copy code
    Detected a @Composable function that overrides an open function compiled with older compiler that is known to crash at runtime. Consider recompiling the dependency with a newer compiler version (>= 2.1.20) to get correct behavior
    But these 2 modules (dependent and dependency) are compiled with the same version of Kotlin Compose compiler 2.2.0-Beta1 I've made the small reproducer for this warning: https://github.com/hondogo/CustomKotlinCompilerPluginFailureRepro/tree/compose-version-warning I'd appreciate any help, thanks!
    v
    • 2
    • 3
  • r

    Rohit Verma

    04/24/2025, 9:01 AM
    Hi everyone, I am creating a reusable ui-testing module for a KMP project but facing some problems with
    compose.uiTest
    dependency. I added this dependency in the
    ui-testing
    module like this. But it has no effect on the module(home) where I implemented
    ui-testing
    module. However, it works when I defined below dependency directly in the home module. Could anyone please help me with this?
    Copy code
    commonTest.dependencies {
        @OptIn(ExperimentalComposeLibrary::class)
        api(compose.uiTest)
    }
    ✅ 1
    • 1
    • 2
  • o

    Oleg Nenashev

    04/24/2025, 2:34 PM
    Declarative Gradle EAP 3 webinar is going live in 30 minutes - https://gradle.com/events/Declarative-Gradle-developer-first-approach-to-Gradle-builds-04-25/ It is not exactly Kotlin specific, but the Declarative Gradle syntax is inspired by Kotlin, and there are already experimental software types for Kotlin and KMP projects
    👍 1
    e
    c
    • 3
    • 3
  • z

    Zhang Zihan

    04/26/2025, 6:51 AM
    Hello! Is
    com.android.kotlin.multiplatform.library
    incompatible with
    applyDefaultHierarchyTemplate
    ? I used the following code:
    Copy code
    kotlin {
        @OptIn(ExperimentalKotlinGradlePluginApi::class)
        applyDefaultHierarchyTemplate {
            common {
                group("java") {
                    withAndroidTarget()
                    withJvm()
                }
            }
        }
    }
    But it doesn't seem to work,
    androidMain
    is not successfully included in
    javaMain
    . I can't import the dependencies added to
    javaMain
    in
    androidMain
    .
    Copy code
    kotlin {
        sourceSets {
            getByName("javaMain").dependencies {
                implementation(libs.jna.platform)
            }
        }
    }
  • e

    Edoardo Luppi

    04/26/2025, 7:16 PM
    I'm using Gradle 8.12, and when I try to use
    HexFormat
    inside
    buildSrc
    , I get the following error. Not sure how to actually fix it.
    m
    • 2
    • 25
  • u

    unnsse

    04/29/2025, 9:55 AM
    Am not able to run unit tests with using
    ./gradlew test
    from the command line... Using
    Gradle 8.14
    wrote a kts project and whereas it was working before in my macOS based command line:
    Copy code
    ./gradlew clean test
    Reusing configuration cache.
    
    BUILD SUCCESSFUL in 750ms
    4 actionable tasks: 4 executed
    Configuration cache entry reused.
    Am able to run my tests from IntelliJ but this is all it does?
    a
    v
    • 3
    • 10
  • m

    martmists

    04/29/2025, 11:12 AM
    I'm having some issues with the vanniktech maven publish plugin, where some artifacts are not getting signed correctly and rejected on mavencentral as result. What can I do to fix it?
    not kotlin but kotlin colored 3
    v
    • 2
    • 4
  • c

    Carter

    04/29/2025, 12:33 PM
    With the new DSL for launching JVM apps, is there a way to run proguard on the jar for launch and distribution? Looking at the DefaultKotlinJvmBinariesDsl source, I’m not sure the necessary hooks are currently public (e.g.
    jarTask
    ) although I wanted to see if someone else has explored this. I’ve got a working series of custom tasks for building a fat jar, then a proguard jar from the fat jar, and was curious if this new DSL could simplify things down.
    t
    • 2
    • 5
  • c

    Carter

    04/30/2025, 9:53 AM
    Are we supposed to be able to declare Kotlin multiplatform targets in convention plugins? It seems to work for js, wasmJs, and native targets. But fails for jvm and android targets.
    h
    v
    +2
    • 5
    • 24
  • r

    Rohit Verma

    04/30/2025, 2:08 PM
    Hi Community, I've a small doubt regarding Gradle dependencies. Please have look at it 🙂 If I created a module say
    testing
    and add some dependencies in the
    commonMain
    source set:
    Copy code
    commonMain.dependencies {
                @OptIn(ExperimentalComposeLibrary::class)
                api(compose.uiTest)
            }
            desktopMain.dependencies {
                api(compose.desktop.currentOs)
            }
    And implements this module into another module, i.e.,
    home
    module in the
    commonTest
    source set:
    Copy code
    commonTest.dependencies {
                implementation(projects.uiTesting)
            }
    Will the dependencies added in the
    commonMain
    inside
    testing
    module included into the build-artifact/APK?
    m
    v
    • 3
    • 7
  • b

    blakelee

    04/30/2025, 5:32 PM
    The documentation here shows that I can add dependencies simply by doing the below (Which is what I’ve had for quite a long time).
    Copy code
    kotlin {
      sourceSets {
        commonMain.dependencies { }
      }
    }
    However in Kotlin 2.1.20 (Multiplatform) it shows this lint warning under the
    dependencies
    text > Suspicious receiver type; this does not apply to the current receiver of type NamedDomainObjectContainer. This will apply to a receiver of type NamedDomainObjectProvider, found in one of the enclosing lambdas. Make sure it’s declared in the right place in the file. What should be the approach here instead? It seems like the documentation should be updated
    t
    • 2
    • 8
  • r

    Rohit Verma

    05/01/2025, 2:41 PM
    Hello Everyone 🙂 I wanted to ask about declaring test dependencies as
    api
    instead of
    implementation
    When we define some test-dependency for a module, eg -
    testing
    , like this:
    Copy code
    commonTest.dependencies {
        api(compose.uiTest)
    }
    Then we cannot access that dependency in a module where I'm implementing
    testing
    module. However, using api should make the dependency transitive but it didn't. Is it a bug or a feature? Because I can easily access the dependency if I define it inside
    commonMain
    source-set using
    api
    . Please let me know if anyone face this issue and how to deal with it. Thanks :)
    e
    v
    r
    • 4
    • 7
  • e

    Edoardo Luppi

    05/02/2025, 6:32 PM
    If I try to use the Antlr Gradle plugin with the Multiplatform plugin I cannot build since it applies the Java Library plugin. What's the solution here?
    v
    • 2
    • 6
  • v

    Vampire

    05/04/2025, 9:35 PM
    Setting
    yarn.downloadBaseUrl = null
    got deprecated in KGP 2.1. It instructs to use
    yarn.downloadBaseUrlProperty
    instead, but that is internal. 😕
    ✅ 1
    • 1
    • 1
  • d

    dead.fish

    05/05/2025, 3:11 PM
    Hi, I recently updated to KSP 2.1.20-1.0.32 (Kotlin 2.1.20) and get an exception when compiling:
    Copy code
    java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.incremental.IncrementalCompilationFeatures.<init>(boolean, boolean, boolean, boolean, boolean, int, kotlin.jvm.internal.DefaultConstructorMarker)'
            at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.makeIncrementalCompilationFeatures(AbstractKotlinCompile.kt:288)
            at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.makeIncrementalCompilationFeatures(KotlinCompile.kt:476)
            at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompilerAsync$kotlin_gradle_plugin_common(KotlinCompile.kt:331)
            at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompilerAsync$kotlin_gradle_plugin_common(KotlinCompile.kt:55)
            at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.executeImpl(AbstractKotlinCompile.kt:314)
            at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(AbstractKotlinCompile.kt:263)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:568)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
            at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:45)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
            at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.execute(IncrementalTaskAction.java:26)
            at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
            at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:244)
    Anybody has seen this before? Thread in Slack Conversation
    • 1
    • 1
  • e

    Elena van Engelen

    05/06/2025, 9:52 AM
    Hi I am encountered multiple issues with azure gradle plugin https://github.com/microsoft/azure-gradle-plugins I am able to work with v 1.13.0 however this does not have support for Managed Identity (MSI azure functions deployment). If I start upgrading to later version I encounter various issues, in the 1.16.1 I am not able to build and getting Jackson incompatibility errors. Does anyone know if there is support for Azure Managed Identity in 1.16.1 and has that working?
    not kotlin but kotlin colored 2
    e
    • 2
    • 3
  • j

    Jacob Kwitkoski

    05/08/2025, 6:27 PM
    Hi all, I'm hoping someone with Kotlin/Gradle experience can answer my question. Context: my project is still on Kotlin
    1.9.24
    due to some internal dependency limitations. Question: If I include a 3rd-party dependency that upgrades
    org.jetbrains.kotlin:kotlin-stdlib
    to
    2.0.21
    (as can be seen by running
    ./gradlew :app:dependencies --configuration releaseRuntimeClasspath
    ) , is that going to cause problems at either compile time or runtime?
    e
    t
    a
    • 4
    • 6
  • l

    loke

    05/09/2025, 2:27 PM
    I have a multiplatform project where in one of the modules I use some features that need an
    --add-opens
    argument. As such, I have a few questions about this: • How can I add this JVM argument to the tests in this module? • Is there a way to get the module to add this parameter to some global list of arguments so all other modules that depend on this one doesn't have to explicitly add this argument to their JVM arguments?
    e
    v
    • 3
    • 16
  • y

    Youssef Shoaib [MOD]

    05/10/2025, 3:11 PM
    I'm in a multimodule project. I have a JVM-only project, and I want to depend on a sibling multiplatform project.
    implementation(project(":foo"))
    doesn't seem to work. Any tips?
    m
    • 2
    • 6