https://gradle.com/ logo
Join Slack
Powered by
# community-support
  • l

    Lauritz Ritter

    11/11/2025, 10:56 PM
    Hey, does anyone know how i can resolve this error in my build, i am using kotlin 2.0.21 and i dont understand why it keeps looking for 1.9.25, maybe its a dumb question but would be grateful if anyone has an idea for me.
    Copy code
    Android gradle plugin: 8.6.0
    Gradle: 8.10.2
    FAILURE:
    Build failed with an exception.
    * What went wrong:
    Could not determine the dependencies of task ':expo-modules-core:compileReleaseKotlin'.
    > Could not resolve all dependencies for configuration ':expo-modules-core:kotlin-extension'.
       > Could not resolve all dependencies for configuration ':expo-modules-core:kotlin-extension'.
          > Could not find org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable:1.9.25.
            Searched in the following locations:
              - <http://maven.production.caches.eas-build.internal/artifactory/libs-release/org/jetbrains/kotlin/kotlin-compose-compiler-plugin-embeddable/1.9.25/kotlin-compose-compiler-plugin-embeddable-1.9.25.pom>
    v
    • 2
    • 4
  • c

    Colton Idle

    11/13/2025, 6:22 AM
    I'm slowly migrating a big project from groovy to kts. I'm trying to migrate this
    Copy code
    allprojects {
      allprojects {
        tasks.withType(JavaCompile).tap {
          configureEach {
            options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
          }
        }
      }
    }
    I want to just delete it because i dont know what it does. this is in the root build file in an android project. No one on the team seems to know why it was needed, but people dont want to remove it 😂 the allprojects within allprojects is just weird to me. I'm not sure if these are even valid lint flags (what linter? android-lint? or does java have a linter?)
    r
    v
    • 3
    • 9
  • n

    Niels Doucet

    11/13/2025, 11:01 AM
    How can I depend on the war created in a different module? I see the plugin creates a variant in the
    archives
    configuration, but I can't seem to resolve that from a different module 🤔
    Copy code
    --------------------------------------------------
    Variant archives
    --------------------------------------------------
    Configuration for archive artifacts.
    
    Capabilities
        - com.acme:web-module:0.0.0 (default capability)
    Artifacts
        - build/libs/web-module-0.0.0.jar (artifactType = jar)
        - build/libs/web-module-0.0.0.war (artifactType = war)
    I tried
    Copy code
    implementation(projects.webModule) { artifact { type = "war" } }
    or
    implementation(projects.webModule) { artifact { extension = "war" } }
    but neither worked resulting in
    Copy code
    Could not find web-module.war (project :web-module).
    According to the documentation, the
    war
    plugin creates a new
    components.web
    component, but I'm not sure how to depend on/resolve that.
    ✅ 1
    v
    • 2
    • 2
  • b

    Bernhard Posselt

    11/13/2025, 12:22 PM
    Is there a way to isolate the classpath of a thirdparty plugin?
    ✅ 2
    c
    v
    y
    • 4
    • 31
  • m

    Miha Markic

    11/14/2025, 8:12 AM
    hi, can somebody help me with running code after build has finished? looks like I've solved it I'm looking at thread https://github.com/gradle/gradle/issues/20151 So, the `BuildListener.buildFinished`still works, but is deprecated and thus I'd like to use an officially recommended approach. However data flow actions don't work for me for a (probably stupid) reason
    v
    • 2
    • 8
  • t

    TheGoesen

    11/14/2025, 9:14 AM
    Hello, using :outgoingVariants I can debug attributes and artifacts provided by the configuration. Is there an option to also show dependencies for these outgoing variants?
    👀 1
    v
    m
    • 3
    • 35
  • m

    Miha Markic

    11/14/2025, 9:22 AM
    is there a better way in 2025 to get flavor value in build script than parsing
    Copy code
    gradle.startParameter.taskRequests.toString()
    ?
    н
    v
    • 3
    • 76
  • f

    Fanish

    11/14/2025, 9:35 AM
    I have imported a gradle project in eclipse. There are two modules A and B. A has dependency on test jar of B something like below testImplementation project(path: 'commonplugins:common.domain', configuration: 'tests') build is getting successfull but eclipse is showing errors for imports of classes coming from test jar of B. test jar configuration in B (commonpluginscommon.domain) is done like this configurations { tests } tasks.register('testsJar', Jar) { archiveClassifier = 'tests' from(sourceSets.test.output) } artifacts { archives(tasks.named("testsJar")) tests testsJar } Why eclipse is failing to resolve?
    v
    • 2
    • 19
  • a

    Andrew Lethbridge

    11/14/2025, 4:27 PM
    Hey folks. Weve been using Gradle project level Toolchains to manage Java versions for quite some time and it all works great. We are trying to start using this feature for the Daemon itself, and are encountering a lot of issues on our corporate laptops. All of the issues manifest themselves as issues with PATH. It's not consistent, some people it works great and others it doesn't work at all. I'm wondering if anyone here has much experience with this feature and may be able to chime in here. We are using Gradle 8.14.1 and trying to run Java 21. All of the issues manifest themselves as "cannot run program". We shell out a lot in our Gradle plugins to run things like docker, etc. It seems like for some reason in some situations, the PATH from the parent process is not being passed to the subsequent daemon that gets spun up from the toolchain JDK.
    v
    t
    • 3
    • 29
  • c

    Colton Idle

    11/14/2025, 7:23 PM
    I'm migrating from groovy to kts. In my root build.gradle we have
    Copy code
    subprojects {
      configurations.configureEach {
        resolutionStrategy ...
      }
      afterEvaluate { subproject ->
        subproject.apply from: "$subproject.rootDir/jacocoTask.gradle"  
      }
    }
    I updated the after evaluate in kts to
    Copy code
    afterEvaluate {
        apply { from("$rootDir/jacocoTask.gradle") }
      }
    but now I get an error in my jacocoTask.gradle file on this line
    task coverageReport(type: JacocoReport...
    So my questions are: 1. Is my conversion correct? 2. I'm assuming the previous code was not correct since I now get an error in my jacoco Task.gradle file? I guess it wasn't being executed at all before? 😱 I'm new to this project so its been ad adventure trying to modernize some of these things 😅
    v
    e
    • 3
    • 20
  • i

    Ivan CLOVIS Canet

    11/15/2025, 12:04 PM
    I want the exact behavior of
    pluginManager.withPlugin
    , but I don't know the plugin ID. • I want to supply a configuration option to be executed when the plugin is added • If the plugin is already added, I want it to execute it immediately However, this plugin doesn't have an ID. It's https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plug[…]n/org/jetbrains/kotlin/gradle/targets/js/nodejs/NodeJsPlugin.kt (from KGP)
    v
    • 2
    • 4
  • m

    Matei David

    11/16/2025, 12:33 AM
    I'd like to detect duplicate publications (in terms of artifacts) in a convention plugin. (E.g. multiple publications including the same toml.) To avoid
    afterEvaluate
    , I tried to listen to publications as they are defined with
    publishing.publications.configureEach {}
    however, I found out that a publication's artifacts need not be known/defined when the publication is added. Next, I tried
    publication.artifacts.configureEach {}
    but this eventually results in strange errors about metadata. I looked a bit around, and I believe
    publication.artifacts
    is currently not "lazy enough", so that when I do
    publication.artifacts
    , it eagerly populates something too early, resulting in problems later on. I'm not sure if
    afterEvaluate
    would really help here. Any other suggestions how to detect duplicate publications reliably?
    v
    • 2
    • 3
  • a

    Adam

    11/16/2025, 12:40 PM
    Is there a util for converting a Gradle .module metadata file into a POM.xml? It doesn't have to be rigorous, I want to experiment with something.
    v
    m
    • 3
    • 3
  • v

    Vlastimil Brecka

    11/16/2025, 11:39 PM
    I have a multi app build, and I want to run a givem task over all of the apps. Which of these is the preferred way? A) to declare a task in root project, which explicistly lists them
    Copy code
    // Root
    tasks.register("lintAllDebug") {
        group = "verification"
        dependsOn(
                ":foo:app:lintAllDebug",
                ":bar:app:lintAllDebug",
                ":quax:app:lintAllDebug"
        )
    }
    B) rely on the same named-ness and just
    ./gradlew lintAllDebug
    v
    • 2
    • 142
  • c

    Colton Idle

    11/17/2025, 7:43 AM
    In a build file does it matter where
    apply plugin
    is called? I have an android app module build file that I'm migrating to kts and I noticed that we have
    apply plugin: "com.google.gms.google-services
    line at the bottom of the build file. Now I'm wondering if theres any reason why it would be at the bottom vs the 10 plugins at the top of the file. seems like someone in the past made a concious decision to put it at the bottom?
    v
    • 2
    • 3
  • n

    Niels Doucet

    11/17/2025, 1:38 PM
    I have a
    copySpec
    that only defines exclusions (with
    exclude
    ) and I'd like to reuse it in multiple tasks that have differing from clauses. Is there a way to do so? (more details in 🧵 )
    ✅ 1
    v
    • 2
    • 5
  • s

    Sebastian Schuberth

    11/18/2025, 10:37 AM
    If I define a custom version catalog from an artifact in my root
    settings.gradle.kts
    file like
    Copy code
    dependencyResolutionManagement {
        versionCatalogs {
            create("ortLibs") {
                from("org.ossreviewtoolkit:version-catalog:71.4.0")
            }
        }
    }
    then what's the correct syntax to depend on an artifacts form that catalog in my project's convention plugins hosted in
    buildSrc
    ?
    n
    v
    • 3
    • 13
  • m

    Martmists

    11/18/2025, 9:59 PM
    I have a
    buildSrc
    folder and
    my-plugin
    , the latter being included with includeBuild. I have a
    common.gradle.kts
    in my buildSrc, but if I try to add
    plugins { id("my-plugin-id") }
    , I get
    Plugin [id: 'my-plugin-id'] was not found in any of the following sources:
    How do I fix this? I tried merging my-plugin with it, but because the plugin depends on kapt and kotlin-compiler-embeddable and such it ended up giving all sorts of gradle/kotlin errors. I also couldn't do
    implementation(project("../my-plugin"))
    it seems.
    v
    • 2
    • 9
  • e

    Eli Graber

    11/18/2025, 10:00 PM
    I saw this post about type-safe project accessors which says they cause an issue with Kotlin IC. Is there an issue tracking this (if there is any plan to address it at all)?
    v
    m
    t
    • 4
    • 5
  • s

    SettingDust

    11/19/2025, 10:45 AM
    Why is my task failing with
    Cannot fingerprint input property 'classpaths.$3.$7.id': value 'xyz.bluspring:AsmFabricLoader:1.3.3-SNAPSHOT:20251024.135151-1' cannot be serialized.
    Don't know how to serialize an object of type org.gradle.api.internal.artifacts.repositories.resolver.MavenUniqueSnapshotComponentIdentifier.
    How to fix it in plugin? https://github.com/terrarium-earth/jvm-multiplatform/blob/main/classpath-api-stubs/src/main/kotlin/net/msrandom/stubs/GenerateStubApi.kt#L25 https://gradle.com/s/vlkllhuaeyuc2
    v
    • 2
    • 1
  • k

    Krysia Michulka

    11/19/2025, 12:44 PM
    i am a hs student and this is my first experience with this stuff. My project requires me to make something so i decided to try and make a planner app. I decided to use react native. Setting up seemed to be going alright till i tried running npx react-native run-android. It keeps telling me this: FAILURE: Build failed with an exception. * What went wrong: Gradle requires JVM 17 or later to run. Your build is currently configured to use JVM 11.
  • k

    Krysia Michulka

    11/19/2025, 12:44 PM
    how do i fix this?
    🧵 1
    v
    • 2
    • 1
  • c

    Colton Idle

    11/19/2025, 4:32 PM
    So I have an interesting issue. I have an android app, and an android library (included via git submodules). The project won't build because the android library/git submodule wont compile because it can't find the toml that's used in the android library/git submodule. If I add a line in my settings.gradle.kts for
    versionCatalogs { create("lib") { from(mysubmoduledir/the.toml )}}
    then it builds (hooray), but then if I try to add a toml in my actual projects gradle folder then I get an error "You can only call the 'from' method a single time." Ideas?
    v
    t
    • 3
    • 74
  • m

    Miha Markic

    11/20/2025, 10:57 AM
    here is my task: I want to generated set keystore password within a gradle task. Is this possible?
  • m

    Miha Markic

    11/20/2025, 10:59 AM
    a silly solution could to write credentials to a file and make signingConfig read from that file
    🧵 1
  • m

    Miha Markic

    11/20/2025, 11:00 AM
    but I'd rather avoid dumping it to a file
    🧵 1
    v
    t
    • 3
    • 26
  • g

    Gabor Torok

    11/20/2025, 4:30 PM
    Hi, as i am trying to understand how the
    runtimeClasspath
    works, i found something weird. we are on
    8.11.1
    , and running this task on different projects yield weird results:
    Copy code
    tasks.register('printMyTestClasspath') {
        dependsOn 'testClasses'
    
        doLast {
            def classpathUrls = sourceSets.test.runtimeClasspath.files
            classpathUrls.each {
                if (!it.toString().contains(".gradle")) { // to exclude external dependencies
                    println "classpath file: $it"
                }
            }
        }
    }
    we have a setup where we have multiple builds depending on each other via
    includeBuild
    . what's weird is that using the above task in show inconsistent results: • sometime the
    main
    class directory is in there (
    build/classes/java/main
    ) and sometime the jar file is in there (
    build/libs/something-1.0.jar
    ) • similarly, this is the same for the included builds - i sometimes see the
    classes/java/main
    of the dependency project, and sometimes i see the
    jar
    • on repeated executions the results seem to stay the same. My questions are: • What could cause this? The
    build.gradle
    files are very similar in our different builds, i did not find any indication of what could cause this difference (sure, i could be missing something.) • Is this a bug? Or something that has been fixed in later versions? • Are there any workarounds that I can use to get some consistency? I want to write tooling that loads the test classes with the class loader, and then checks stuff on them - but i am getting random errors, based on weather some projects classpath has the
    jar
    or the
    classes
    ...
    c
    v
    • 3
    • 15
  • w

    William Chong

    11/20/2025, 9:19 PM
    Hi I'm trying to make a minecraft mod by my own very first time and I've met an issue while trying to run ./gradlew.bat build .\gradlew.bat : At line:1 char:1 + .\gradlew.bat build > build_output.txt 2>&1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'RealRender'.
    Could not resolve all artifacts for configuration 'classpath'.
    > Could not find net.fabricmcfabric loom1.7.6. Searched in the following locations: - https://maven.fabricmc.net/net/fabricmc/fabric-loom/1.7.6/fabric-loom-1.7.6.pom - https://repo.maven.apache.org/maven2/net/fabricmc/fabric-loom/1.7.6/fab ric-loom-1.7.6.pom - https://plugins.gradle.org/m2/net/fabricmc/fabric-loom/1.7.6/fabric-loo m-1.7.6.pom Required by: buildscript of root project 'RealRender' * Try:
    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to generate a Build Scan (Powered by Develocity).
    Get more help at https://help.gradle.org.
    BUILD FAILED in 6s and I tried using other version of gradle and it doesnt help I’m sorry for taking up your valuable time I know it might be a easy issue for you guys to solve. Thank you for your patience and guidance
    c
    v
    • 3
    • 5
  • m

    Miha Markic

    11/21/2025, 9:28 AM
    Is there a way to run a gradle task always when all the tasks finish? (to clean up) I'm thinking android studio but this is most probably generic question for gradle. If not, I'll ask in android channel.
    m
    a
    • 3
    • 15
  • c

    Colton Idle

    11/21/2025, 6:03 PM
    Are there any "popular" or big name library authors that self host their artifacts? (basically. not on maven central?) I'm trying to possibly self host (for reasons) and trying to see what the "industry standard" is in terms of hosting the artifacts, but also how the documentation states the inclusion of the artifact repository.