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

    Slackbot

    10/01/2025, 9:28 AM
    This message was deleted.
    v
    • 2
    • 1
  • s

    Sofia Louisy

    10/01/2025, 10:09 AM
    Hi! I'm new to gradle and have started a new gradle project in eclipse. It gives me a lib folder, and a gradle folder, but not an app-folder. I cannot find anywhere in the new-project-wizard that I want a java application, and I havn't found an easy way to create my java application there
    d
    v
    • 3
    • 3
  • k

    Kanstantsin Shautsou

    10/01/2025, 11:28 AM
    How to deal with such warnings? visible is not used in any project related code
    m
    v
    • 3
    • 17
  • j

    Joseph Ottinger

    10/01/2025, 5:58 PM
    hi, all. I have an unfortunately complex build with groovy and gradle 8, using a series of plugins, etc., that I need to convert to be ABLE to be an airgapped build (i.e., have an offline construction such that it doesn't touch a network that it would have no access to anyway). There are offline dependency plugins, but they're badly out of date, and they resolve plugin dependencies poorly. I have a few options in mind, but before I chase them too far, I wanted to see if there's conventional wisdom to apply here.
    e
    • 2
    • 2
  • a

    Adam

    10/02/2025, 4:01 PM
    Does Gradle expose a util for checking if a version range is 1. valid, and 2. contains a given version https://docs.gradle.org/current/userguide/dependency_versions.html
    e
    v
    • 3
    • 4
  • n

    Niels Doucet

    10/03/2025, 10:51 AM
    When trying to upgrade one of our more complex gradle projects to gradle 9.+ (from 8.14.3), I'm seeing the following error coming from the
    io.qameta.allure
    plugin:
    Copy code
    org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':selenium-tests:check'.	
    ... SNIP ...
    Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':selenium-tests:test'.
    ... SNIP ...
    Caused by: org.gradle.api.InvalidUserCodeException: Cannot mutate the artifacts of configuration ':selenium-tests:allureRawResultElements' after the configuration was consumed as a variant. After a configuration has been observed, it should not be modified.
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:1229)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.lambda$validateMutationType$0(DefaultConfiguration.java:319)
    at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:226)
    at org.gradle.api.internal.DefaultDomainObjectCollection.assertCanMutate(DefaultDomainObjectCollection.java:453)
    at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:273)
    at org.gradle.api.internal.DelegatingDomainObjectSet.add(DelegatingDomainObjectSet.java:115)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationPublications.artifact(DefaultConfigurationPublications.java:137)
    at io.qameta.allure.gradle.adapter.AllureAdapterExtension.exposeArtifact(AllureAdapterExtension.kt:167)
    at io.qameta.allure.gradle.adapter.AllureAdapterExtension.access$exposeArtifact(AllureAdapterExtension.kt:31)
    at io.qameta.allure.gradle.adapter.AllureAdapterExtension$gatherResultsFrom$1.execute(AllureAdapterExtension.kt:104)
    at io.qameta.allure.gradle.adapter.AllureAdapterExtension$gatherResultsFrom$1.execute(AllureAdapterExtension.kt:102)
    It seems to be a negative interaction with multiple other plugins. So far discovered the issue popping up with
    jacoco-report-aggregation
    and
    com.autonomousapps.build-health
    . It goes away when I make sure not to have the failing module be affected by those 2 plugins. Unfortunately, it doesn't happen in a trivial setup, so I'm struggling to figure out the root cause. For reference, the code that triggers the error in the allure plugin: https://github.com/allure-framework/allure-gradle/blob/main/allure-adapter-plugin/[…]otlin/io/qameta/allure/gradle/adapter/AllureAdapterExtension.kt Is there an easy way to figure out what's causing a configuration to be consumed as a variant? And is the allure plugin actually doing something wrong here or should I assume it's our configuration that's wrong?
    ✅ 1
    v
    • 2
    • 37
  • e

    Eli Graber

    10/03/2025, 4:12 PM
    Is there any chance of support for ".java-version" being added to Gradle, i.e. if there is a
    .java-version
    file it would be used to set the daemon toolchain?
    👀 1
    til 1
    ➕ 1
    m
    v
    a
    • 4
    • 6
  • n

    Nathan Kulzer

    10/05/2025, 5:10 AM
    Does maven-publish have any way to write an arbitrary filename (e.g. a Python wheel) to the remote?
    v
    t
    • 3
    • 20
  • r

    Rahul pratap singh

    10/06/2025, 4:54 PM
    Copy code
    npx react-native run-android
    info Launching emulator...
    info Successfully launched emulator.
    info Installing the app...
    
    > A build operation failed.
          Could not read workspace metadata from C:\Users\RAHUL PRATAP SINGH\.gradle\caches\8.14.3\transforms\c82eb49d1e40a7062eeb6dcb22a32921\metadata.bin
       > Could not read workspace metadata from C:\Users\RAHUL PRATAP SINGH\.gradle\caches\8.14.3\transforms\c82eb49d1e40a7062eeb6dcb22a32921\metadata.bin
    
    * 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 get full insights.
    > Get more help at <https://help.gradle.org>.
    
    BUILD FAILED in 2s
    error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where: Settings file 'C:\Projects\React Native\reactNativeCLI3\android\settings.gradle' line: 2 * What went wrong: Error resolving plugin [id: 'com.facebook.react.settings'] > A build operation failed. Could not read workspace metadata from C:\Users\RAHUL PRATAP SINGH\.gradle\caches\8.14.3\transforms\c82eb49d1e40a7062eeb6dcb22a32921\metadata.bin > Could not read workspace metadata from C:\Users\RAHUL PRATAP SINGH\.gradle\caches\8.14.3\transforms\c82eb49d1e40a7062eeb6dcb22a32921\metadata.bin * 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 get full insights. > Get more help at <https://help.gradle.org>. BUILD FAILED in 2s.
    info Run CLI with --verbose flag for more details.
    Help please
    v
    • 2
    • 1
  • m

    Mike Wacker

    10/06/2025, 6:34 PM
    When you're using the Gradle Docker image and building with
    gradle
    (not
    ./gradlew
    ), is it fairly standard to add this to
    .dockerignore
    ?
    Copy code
    gradle*
    !gradle/libs.versions.toml
    Or could be there be complications here?
    v
    t
    • 3
    • 4
  • e

    Edwin Günthner

    10/07/2025, 9:40 AM
    We upgraded our build setup from 8.12 to 9.1 and I just discovered that our unit test handling doesn't work properly any more. We have a number of sub projects, and we are using
    ignoreFailures=true
    to keep running unit tests, even after a failure in one of the sub projects.
    We have a failure checker that keeps a counter & check for unit test failures.
    Copy code
    reporting {
        reports {
            val failureCheck = gradle.sharedServices.registerIfAbsent("testFailureCheck", TestFailureCheck::class) {}
            @Suppress("UnstableApiUsage")
            val testAggregateTestReport by creating(AggregateTestReport::class) {
                testSuiteName = "unit-tests"
                reportTask.configure {
                    doLast {
                        // print a short summary and fail build if any test failed
                        failureCheck.get().execute(destinationDirectory.get().asFile)
                    }
                }
                test.configure {
                    dependsOn(reportTask)
                }
            }
    That's the crucial part - with gradle 8.12, that
    doLast
    got called always, and then our check got executed.
    With 9.1, the code given to
    doLast
    isn't invoked any more. (I think 8.13 slightly change the overall handling, as it introduced that
    testSuiteName
    property for the aggregate code.
    Any idea anyone how to fix this? Resolved: the problem is this line:
    testSuiteName = "unit-tests"
    Previously, the test report used an enum, and now asked for a string, so I just wrote down "unit-tests". Which is wrong - this needs to refer an existing test suite, and in our case, that would be the default ("test"). With that change, things work as expected.
    t
    v
    • 3
    • 10
  • m

    Maanrifa Bacar Ali

    10/07/2025, 3:31 PM
    Hello all, is there a public API to add custom Kotlin DSL accessors directly accessible from
    build.gradle.kts
    — like how
    kotlin-dsl
    generates accessors for extensions?
    v
    • 2
    • 10
  • c

    Colton Idle

    10/07/2025, 8:07 PM
    Confused by some numbers from gradle-profiler. I'm trying to benchmark what a typical "rebuild" of an android app would be after I add a line
    println()
    and rebuild. If I do this like 10 times in a row manually I get about a ~4 second build time. If I use gradle profiler with
    apply-non-abi-change-to
    ("Change the body of a public method in a Java or Kotlin source class.") the lowest time I'll see is a 7 second build time over the 10 default runs (with default 6 warm ups). Anyone have a clue on how to debug why it seems like like build time is consistently close to twice of what "real world" testing shows?
    a
    • 2
    • 10
  • j

    Jeroen Meijer

    10/08/2025, 5:22 AM
    Building precompiled script plugins in a multi project setup uses a lot of memory We have a dedicated project for building convention plugins. This project has multiple subprojects (roughly 20). Some plugins are compiled with
    groovy-gradle-plugin
    and some are compiled with the
    kotlin-dsl
    plugin. The problem is that both these plugins together seem to use ~200 MB on average on each subproject. This memory seems not to be freed when the subproject is done. On a simple hello world project (with 20 subproject) I built https://github.com/Meijuh/precompiled-mem-issue, one can see that close to 4GB is necessary. The easiest way I found to measure the used memory is by running the build in a docker container (e.g.,
    docker run -it --memory=12g --cpus="8" -v .:/workspace -v eclipse-temurin:21.0.8_9-jdk-jammy bash
    ) and then running
    docker stats
    . Running
    gradle-profiler
    won't immediately work here because of all the process forking that is going on. Note that 4GB of memory on a hello world example is problematic, because our real world case attaches external dependencies to the plugins etc, causing 12GB to be used there, which causes scheduling issues on our Jenkins cluster. I have also created a single project variant https://github.com/Meijuh/precompiled-mem-issue/tree/single-project, which does not cause the memory to blow up. And this looks like the intended approach as is hinted by the plural name of https://docs.gradle.org/current/javadoc/org/gradle/plugin/devel/tasks/ValidatePlugins.html. However, moving all the plugins to a single project won't work for our real world case because: • Some convention plugins depend on other convention plugins, making it hard to generate a dependency graph of plugins (which is easy in a multi-project setup). • Most convention plugins depend on external dependencies, such as Spotless. This means every plugin would require the same (unused) external dependencies, cluttering the classpath in the build environment of projects that apply the convention plugins. • The code just gets messy. I've tried disabling the
    ValidatePlugins
    task (as it forks uncontrollably), limiting the number of Gradle workers, compiling the KTS scripts "in-process", but none seems to really help. Any ideas how to continue? I can imagine I am missing a helpful Gradle config, or that I have reached a Gradle limitation and I could create a feature request to improve the memory usage for this use case?
    👀 1
    m
    v
    • 3
    • 21
  • o

    Oliver Kopp

    10/08/2025, 7:56 PM
    What can I do at 404 at plugin repository? Resource missing. [HTTP HEAD: https://plugins.gradle.org/m2/org/openrewrite/rewrite/org.openrewrite.rewrite.gradle.plugin/7.17.0/org.openrewrite.rewrite.gradle.plugin-7.17.0.jar] Resolved plugin [id: 'org.openrewrite.rewrite', version: '7.17.0']
    e
    • 2
    • 3
  • d

    Daren Burke

    10/09/2025, 11:28 AM
    I have a plugin that copies an included resource using getResourceAsStream. This works just fine in unix/linux OS'es, but not so much on Windows (code simplified to show just the problem) The resourceFile is a string that contains a relative path ('common-config/checkstyle/checkystyle.xml')
    Copy code
    ClassLoader classLoader = FileUtil.class.getClassLoader();
    try (InputStream inputStream = classLoader.getResourceAsStream(resourceFile)) {
        Files.copy(inputStream, config.toPath(), StandardCopyOption.REPLACE_EXISTING);
    }
    The inputStream is null when running on windows, though the jar properly has the file in it, and the path to the resourceFile is correct. Any ideas why Windows classloader would have different results?
    v
    • 2
    • 3
  • a

    Adam

    10/09/2025, 4:10 PM
    Hello, I have a bit tricky issue to solve. I have a repository using composite builds. This repository works as a technical platform and is meant to publish both libraries and gradle plugins. Within this repository we have multiple builds plugins <- Is a simple build which does not include any other. It also only pulls in external dependencies published on maven repository or similar (nothing in the same repo) core <- All libraries, include "plugins" which is used to setup streamlined subproject tooling <- Here we build general help tools, which uses logic from core and plugins, this means that we write both libraries and plugins. Most plugins gets hence transitative dependencies to "core" since on some level in the dependency graph core is used. test-system <- pulls in plugins, core and tooling Now... The issue is when I try to apply plugins written in tooling, which have transitative dependencies to "core". It seems like Gradle is not able to substitute such dependencies under plugin resolution, while the same dependencies gets substituted fine for libraries and services in the test-system. Question: What are the approach for using plugins in a larger composite build setup, with transitative dependencies to other builds? What is the recommended approach?
    👀 1
    v
    • 2
    • 10
  • e

    Edwin Günthner

    10/09/2025, 7:09 PM
    Wondering: is there a performance impact from running gradle builds with --stacktrace enabled by default? We are facing a gradle issue that shows up infrequently on our verification built, and in order to collect the information needed for my issue against gradle I need the corresponding stacktrace. The easiest would be to simply add --stacktrace for all our verification builds, but I am wondering if there is any "cost" associated with that?
    m
    • 2
    • 2
  • d

    Daren Burke

    10/10/2025, 11:16 AM
    I saw an (old) post on the Gradle community that stated plugin version resolution functioned with 'latest.release' or the other notations to always provide latest like '1.+', etc. since Gradle 7.x I am seeing this is not working properly in my build environment with Gradle v9.1.0, but I am unable to see what version of a plugin is actually resolved, with gradlew --info, I only see '1.+' was resolved, but not the specific version that was selected. gradlew dependencies doesn't show the plugins dependency tree -- is there a command that will show the specific plugin versions selected for a build?
    s
    v
    • 3
    • 27
  • c

    Caleb Cushing

    10/10/2025, 7:07 PM
    When creating a feature variant using the groovy DSL. How would I make test depend on my feature variant? I did a Google and I found and answer but I guess I want to make sure I'm using configurations properly given the unfortunate potential for unlazy API usage in my opinion. Also if there's any way to avoid four extendsfrom minimum... And is there any way to extend from platforms that would have been defined there? At least I hope they were defined as platforms
    v
    • 2
    • 2
  • m

    Mike Wacker

    10/10/2025, 7:46 PM
    https://github.com/avast/gradle-docker-compose-plugin/issues/486 Any insights into whether the problem is with the plugin or Gradle's configuration cache? Slightly lean towards plugin (although it should support the configuration cache), but the error message makes me wonder. There's also some weird behavior where the issue doesn't repro if you build first with the cache disabled, but then build the exact same code with the cache enabled.
    Copy code
    Execution failed for task ':app:test'.
    > Cannot cast object 'org.gradle.internal.serialize.codecs.core.ClosureCodec$BrokenObject@46f481e2' with class 'org.gradle.internal.serialize.codecs.core.ClosureCodec$BrokenObject' to class 'com.avast.gradle.dockercompose.TasksConfigurator'
    The issue includes a fairly simple MCVE.
    v
    • 2
    • 1
  • s

    Suresh Vadlamudi

    10/10/2025, 7:50 PM
    Wondering how to overwrite duplicate files while bunding the war. Not finding any overwrite duplicate strategy in documentation. If i use EXCLUDE strategy, its keeping only the first file and ignoring my 2nd file file. If i use INCLUDE strategy, its keeping both files in war but i need to keep only the 2nd file. and rest of the options(FAIL, WARN, INHERIT) will not help in this case. Hope am not the first one facing this challenge.
    m
    v
    • 3
    • 3
  • m

    Matthew Von-Maszewski

    10/10/2025, 9:25 PM
    https://gradle-community.slack.com/archives/CA7UM03V3/p1760124221741589 My company used to checkin the gradle revision to our github repository. Gradle would be part of our CircleCI github download, i.e. our bandwidth cost. That was gradle 6.0.1. We moved to gradle 8.x. The download zip exceeded 100M. It is too large for a standard checkin. Now each of our CircleCI builds downloads gradle 8.11 against gradle's bandwidth cost, not ours. I suggest this might be a cost problem/opportunity to gradle.org.
  • c

    Colton Idle

    10/10/2025, 9:27 PM
    I'm unfortunately working on a project where i have to migrate some legacy definition blocks to the modern way this is what ive got left
    Copy code
    buildscript {
       // this is all I have left to migrate
        ext.kotlin_version = '1.9.24'
        dependencies {
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
            classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
            classpath 'com.android.tools.build:gradle:8.10.1'
            classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
            classpath "org.jacoco:org.jacoco.core:0.8.13"
        }
    }
    it seems like theres no way to just migrate to new plugins block directly... instead you have to lookup the documentation for each plugin. am i correct in my understanding? and what do i do if a plugin doesn't publish how to use the new plugins block (like butterknife)?
    e
    • 2
    • 13
  • h

    Harry Jackson

    10/11/2025, 12:05 AM
    After upgrading from Gradle 8.11.1 -> 9.0.0 some UTF-8 characters in html are not rendering properly. The following two images is one example of what a before-and-after picture looks like.
    c
    • 2
    • 5
  • h

    Harry Jackson

    10/11/2025, 12:06 AM
    The only change is the gradle wrapper version used to build the jar.
    🧵 2
    v
    • 2
    • 1
  • a

    Allan Kelly

    10/11/2025, 7:53 AM
    👋 Hello, team!
    👋 1
    👋🏻 1
  • m

    Maksym Moroz

    10/11/2025, 3:29 PM
    I want my convention plugins to notify users that they should have applied the plugin that convention plugin is for explicitly (if they only applied convention plugin without plugin to configure) Previously I relied on
    afterEvaluate
    but since this discussion about just how much of a legacy approach
    afterEvaluate
    is, I have been looking for a good solution for this. Would
    BuildService
    with
    FinishEventListener
    that throws if plugins were not applied be an idiomatic approach?
    m
    v
    • 3
    • 5
  • a

    Adam

    10/11/2025, 4:35 PM
    What is the Dataflow Actions docs section Using lifecycle event providers supposed to be demonstrating? A BuildWorkResult doesn't contain
    buildInvocationId
    ,
    workspaceId
    , or
    userId
    - just
    getFailure()
    .
    v
    • 2
    • 2
  • s

    ScØtty Kauppinen

    10/11/2025, 8:42 PM
    Keep having this issue, can someone tell me a way to fix it, ive tried multiple diffrent things: * What went wrong: Execution failed for task 'appcleanMergeDebugAssets'.
    java.io.IOException: Unable to delete directory 'C:\Users\scott\Documents\ClearEntry
    v
    • 2
    • 1