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

    Vlastimil Brecka

    02/04/2025, 4:36 PM
    Copy code
    FROM bellsoft/liberica-openjdk-alpine:17 AS build-environment
    WORKDIR /product-app
    
    # Cache gradlew
    COPY gradlew build.gradle settings.gradle ./ <-----------------
    COPY gradle gradle <-----------------
    RUN ./gradlew tasks <-----------------
    
    # Copy sources & build
    COPY . .
    RUN ./gradlew :app:bootJar
    is this an idiomatic way to create `Dockerfile`s when building with
    ./gradlew
    ? is there maybe something neater? or possible a single copy command?
    v
    j
    • 3
    • 10
  • b

    Balakrishna Dongrekar

    02/05/2025, 4:54 AM
    Good Morning , i am getting this error can anyone help me to fix
    Copy code
    (node:2592) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    info A dev server is already running for this project on port 8081.
    info Installing the app...
    > Task :app:mergeDebugResources FAILED                                                                                              
    
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.                                         
    
    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
    
    For more on this, please refer to <https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings|https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings> in the Gradle documentation.
    57 actionable tasks: 9 executed, 48 up-to-date
    
    info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: <https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor|https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor> 
    
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:mergeDebugResources'.
    > A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
       > Resource compilation failed (Failed to compile values resource file C:\Users\balakrishnad\Desktop\Task\SpeechToText\android\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.nio.file.InvalidPathException: Illegal char <:> at index 43: com.speechtotext.app-mergeDebugResources-24:/values/values.xml). Check logs for more details.
    
    * 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|https://help.gradle.org>.
    
    BUILD FAILED in 8s
    error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable > Resource compilation failed (Failed to compile values resource file C:\Users\balakrishnad\Desktop\Task\SpeechToText\android\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.nio.file.InvalidPathException: Illegal char <:> at index 43: com.speechtotext.app-mergeDebugResources-24:/values/values.xml). Check logs for more details. * 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|https://help.gradle.org>. BUILD FAILED in 8s.
    info Run CLI with --verbose flag for more details.
    🧵 1
    v
    • 2
    • 2
  • d

    Devraj Nivriti Sutar

    02/05/2025, 5:05 AM
    Error resolving plugin [id: 'com.facebook.react.settings']
    A problem occurred configuring project 'gradle pluginreact-native-gradle-plugin'.
    > java.util.zip.ZipException: zip END header not found What should I do I am facing this error .
    v
    s
    • 3
    • 3
  • s

    Sangam Subedi

    02/05/2025, 2:53 PM
    • C:\Users\HP 15\.gradle\caches\8.12.1\transforms\981548a07e6c7b0934b5ca3f40d94ed8-239570f4-d615-4076-b2d3-0a6d18c1bfe9 -> C:\Users\HP 15\.gradle\caches\8.12.1\transforms\981548a07e6c7b0934b5ca3f40d94ed8 • Could not move temporary workspace (C:\Users\HP 15\.gradle\caches\8.12.1\transforms\981548a07e6c7b0934b5ca3f40d94ed8-239570f4-d615-4076-b2d3-0a6d18c1bfe9) to immutable location (C:\Users\HP 15\.gradle\caches\8.12.1\transforms\981548a07e6c7b0934b5ca3f40d94ed8) How can i fix these problems in my PC in Android Studio
    v
    • 2
    • 1
  • g

    Goodness Nzube

    02/05/2025, 3:04 PM
    Hello Team please i need help please thank you
    m
    c
    v
    • 4
    • 9
  • s

    Sreenivas

    02/06/2025, 7:00 AM
    I have a publishing task like this:
    Copy code
    publishing {
        publications {
            rootBOM(MavenPublication) {
                from components.javaPlatform
                artifactId = 'my-framework-root-bom'
            }
        }
    s
    v
    • 3
    • 7
  • a

    Adam

    02/06/2025, 1:44 PM
    Composite Builds for libraries dependencies Hello Gradle team. I have a question regarding composite builds. I am trying to setup a repository using different builds, where one of the build depends on the other. To keep it simple lets say I have module1 and module2. Now in module1 I build custom plugins but also java libraries, these will be published and used in other repositories, BUT in this repository I also want to test these publications in module2, hence "composite builds" seem to be a good match. In module2 I add a dependency to module1 with includeBuild, to get plugins I add it in the pluginManagement scop in the settings file, and this work well. I can import the plugins and use them in my different subprojects in module2. However, when it comes to regular libraries I have a hard time to get the imports to work, The documentation regarding this scenario is quite shallow we not many examples, could you please help me understand how this is meant to be applied? UPDATE: Ok I got something working however it is a bit cumbersome, it seems like I need to configure "substitution rules" for the libraries to be accessed. Like this:
    Copy code
    includeBuild("../core") {
        name = "core"
        dependencySubstitution {
            substitute(module("se.vermiculus.veriprimer:veriprimer-platform-common"))
                    .using(project(":platform:common"))
            substitute(module("se.vermiculus.veriprimer:veriprimer-testing-infrastructure-test-execution"))
                    .using(project(":testing:infrastructure:test-execution"))
            substitute(module("se.vermiculus.veriprimer:veriprimer-testing-utilities-request-execution"))
                    .using(project(":testing:utilities:request-execution"))
        }
    }
    It is not possible to not have to specify each module like this? With the plugins this was not needed.
    v
    t
    • 3
    • 15
  • n

    Niels Doucet

    02/06/2025, 3:34 PM
    I'm getting an NPE coming from the ProblemReporter:
    Copy code
    Caused by: java.lang.NullPointerException: group.displayName must not be null
            at org.gradle.problems.internal.impl.DefaultProblemsReportCreatorKt$problemId$1$1.invoke(DefaultProblemsReportCreator.kt:104)
            at org.gradle.problems.internal.impl.DefaultProblemsReportCreatorKt$problemId$1$1.invoke(DefaultProblemsReportCreator.kt:102)
    ...SNIP...
            at org.gradle.internal.cc.impl.problems.JsonWriter.jsonObjectList(JsonWriter.kt:77)
            at org.gradle.problems.internal.impl.DefaultProblemsReportCreatorKt$problemId$1.invoke(DefaultProblemsReportCreator.kt:102)
    It looks like a property passed in by the report creator itself: https://github.com/gradle/gradle/blob/master/platforms/ide/problems/src/main/kotli[…]g/gradle/problems/internal/impl/DefaultProblemsReportCreator.kt Unfortunately I have no context clues about why this happens and it seems to be a local-only problem. Has anyone seen this before?
    🙅‍♂️ 1
  • g

    Giuseppe Barbieri

    02/06/2025, 3:57 PM
    I have an existing project with
    buildSrc
    with precompiled script plugins in Groovy. May I add alongside a precompiled script plugin in Kotlin? trying to add
    id 'org.gradle.kotlin.kotlin-dsl'
    to the
    buildSrc/build.gradle
    , but I do get: > Plugin [id: 'org.gradle.kotlin.kotlin-dsl'] was not found in any of the following sources:
    v
    j
    r
    • 4
    • 16
  • j

    Jesse Wilson

    02/07/2025, 12:21 AM
    I’m using dependency locking and includeBuild and I’m getting a crash! Any ideas?
    Copy code
    java.lang.UnsupportedOperationException
            at org.gradle.internal.locking.DefaultDependencyLockingProvider$LockingDependencySubstitution.artifactSelection(DefaultDependencyLockingProvider.java:277)
            at org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DefaultDependencySubstitutions$CompositeBuildSubstitutionAction$1.artifactSelection(DefaultDependencySubstitutions.java:388)
            at org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DefaultDependencySubstitutions$AbstractDependencySubstitutionAction.execute(DefaultDependencySubstitutions.java:403)
    v
    • 2
    • 2
  • t

    Thomas Chan

    02/07/2025, 8:18 AM
    We have a gradle project
    A
    with composite build child projects
    X
    and
    Y
    .
    A
    ,
    X
    and
    Y
    are all version controlled with git and has their own git repositories.
    X
    and
    Y
    are git submodules for
    A
    . This set up makes development very easy and the structure is quite clean. Trouble is, now we have to add a shared library
    S
    which both
    X
    and
    Y
    depends on. Is there an elegant way to do this while still using git submodules and gradle composite builds?
    v
    • 2
    • 10
  • j

    Javi

    02/07/2025, 10:41 AM
    Is it possible to use the Swift Library plugin to create a library that can be easily consumed by a Kotlin Multiplatform project? Maybe to configure it like a cocoapod library or similar.
    p
    • 2
    • 1
  • s

    Sreenivas

    02/07/2025, 11:38 AM
    Writing a plugin for computing sha1sum for the class files, here i'm taking few input properties.. but i'm facing difficulties while running the program.. though i'm passing properties.. inside task execution, its giving always null.. those properties are not being set..
    n
    v
    • 3
    • 8
  • m

    Matei David

    02/07/2025, 7:14 PM
    I ran into an issue with TestKit and Kotlin. I define an extension, e.g.:
    Copy code
    interface MyLibraryExtension {
      fun getValue(): String
      ...
    }
    I create such an object and register it as
    myLibrary
    extension upon applying the plugin. I want to test it with TestKit. In a test project
    build.gradle.kts
    : • This works:
    println(myLibrary::class.java.getMethod("getValue").invoke(myLibrary))
    • But this fails:
    println(myLibrary.getValue())
    with "Unresolved reference: getValue". So Gradle under TestKit: • Finds the extension object just fine. • It can inspect it and use it via reflection just fine. • It cannot deal with the extension without reflection...?! Am I missing something for this to work in TestKit? It all works fine if I try it out on the CLI without TestKit. Update: It even works if I use Groovy
    build.gradle
    instead of Kotlin
    build.gradle.kts
    in the test project...
    v
    • 2
    • 3
  • s

    Sergej Koščejev

    02/08/2025, 8:08 AM
    When and why should I prefer using
    Directory
    and
    RegularFile
    over
    File
    in my API? The API that Gradle provides for working with Directory and RegularFile objects seems to be a bit lacking compared to plain Files.
    v
    • 2
    • 6
  • s

    Sergej Koščejev

    02/08/2025, 6:44 PM
    Can I somehow make Gradle substitute plugins in an included build using subprojects from the parent (including) build? Adding
    includeBuild(".")
    in the parent doesn't seem to work.
    m
    • 2
    • 2
  • z

    Ziad Tarik

    02/08/2025, 11:14 PM
    Hey
    👋 1
  • z

    Ziad Tarik

    02/08/2025, 11:14 PM
    I need some help if possible
    c
    v
    • 3
    • 2
  • m

    Muskan Verma

    02/09/2025, 1:30 PM
    Hello !! I am getting an error message in my react native project it is related to gradle. Please help me - error message is as follows -
    Copy code
    FAILURE: Build completed with 2 failures.
    1: Task failed with an exception.
    -----------
    * Where:
    Settings file 'D:\Muskan\React Native\GoogleMaps\android\settings.gradle' line: 2
    
    * What went wrong:
    Error resolving plugin [id: 'com.facebook.react.settings']
    > A problem occurred configuring project ':gradle-plugin:react-native-gradle-plugin'.
       > java.util.zip.ZipException: zip END header not found
    
    * 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>.
    ==============================================================================
    
    2: Task failed with an exception.
    -----------
    * What went wrong:
    Failed to query the value of property 'buildFlowServiceProperty'.
    > Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@26ad70f4 of type BuildFlowService.Parameters
       > A problem occurred configuring project ':gradle-plugin:react-native-gradle-plugin'.
          > java.util.zip.ZipException: zip END header not found
    
    * 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>.
    ==============================================================================
    v
    • 2
    • 3
  • s

    Segunfunmi Oyedele

    02/10/2025, 5:03 AM
    I'm getting an erroer with namespace on several packages. I tried using AGP to make the updates but it's not working and making the changes one package after another is not very visible. Any help? Pls see error below
    v
    • 2
    • 5
  • s

    Sreenivas

    02/10/2025, 12:43 PM
    I'm working on a framework which has several consumers. Framework's dependencies are not getting added to consumer's classpath. Below are details..
    • 1
    • 8
  • a

    Akash Verma

    02/11/2025, 8:49 AM
    👋 Hello, team! i am working on the react-native project my project is working fine but i closed it on last friday but i am try to run it today i shows error : "Could not determine the dependencies of null.
    Could not resolve all dependencies for configuration 'classpath'.
    > The new Java toolchain feature cannot be used at the project level in combination with source and/or target compatibility" can any one help am not able to resolve this
    v
    • 2
    • 13
  • g

    Giuseppe Barbieri

    02/11/2025, 11:19 AM
    in my
    ~.gradle/wrapper/dists/gradle-8.12.1-all
    I see an additional folder representing some hash
    5akij8gnr65tdxupapyu22pqa
    , which kind of hashing is that?
    t
    • 2
    • 2
  • r

    Robert Elliot

    02/11/2025, 11:46 AM
    Hi - I'm trying to improve on the GraalVM plugins setup. Unfortunately I'm running into a circular dependency problem. At a high level: •
    nativeCompile
    needs the jar file to include a
    META-INF/native-image/<project_name>/reachability-metadata.json
    file, so
    nativeCompile
    transitively depends on
    classes
    • This can be generated with a test run using an agent - I've registered a new task of type
    Test
    called
    agentTest
    for this • A test run obviously has to depend on
    classes
    So I end up with:
    nativeCompile
    ->
    agentTest
    (output
    build/generated/sources/main/resources/META-INF/native-image/<project_name>/reachability-metadata.json
    ) ->
    classes
    But I need to run
    classes
    again between
    nativeCompile
    and
    agentTest
    so that
    META-INF/native-image/<project_name>/reachability-metadata.json
    is part of the jar file that
    nativeCompile
    works on... Perhaps I need a whole parallel flow of
    nativeJar
    ->
    nativeClasses
    that can know about the output of `agentTest`; but then I'm not sure how to make
    nativeCompile
    use the output of my
    nativeJar
    rather than the
    jar
    task it presumably knows about.
    e
    • 2
    • 2
  • b

    Bradley Campbell

    02/11/2025, 1:52 PM
    Hey—does anyone here know of any documentation, blogs, or general guidance on debugging and understanding/debugging slow configuration times? We're seeing configuration phases on CI of 6—8 minutes at the moment (and there's no way that can be normal/expected), but I can't see anything obviously at fault in the build scans
    v
    a
    • 3
    • 4
  • m

    Matthew Inger

    02/11/2025, 2:42 PM
    Hey all, so i'm trying to create local plugin for some code generation, I'm using a NamedDomainObjectContainer:
    Copy code
    abstract class StringGeneratorSegment @Inject constructor(
        project: Project,
        objects: ObjectFactory
    ) {
        abstract val name: String
    
        val inputDirectory =
            objects.directoryProperty().convention(project.layout.projectDirectory.dir("src/${name}"))
    
        val outputDirectory =
            objects.directoryProperty().convention(project.layout.buildDirectory.dir("strings/${name}"))
    
        override fun toString(): String {
            return "StringGeneratorSegment(name=${name}, inputDirectory=${inputDirectory.get()}, outputDirectory=${outputDirectory.get()}"
    
        }
    }
    
        val segments: NamedDomainObjectContainer<StringGeneratorSegment> =
            project.container(StringGeneratorSegment::class)
    I'd like to use the "name" property in the convention for the input and output directories, but those seem to be "null" when the convention is set. Is there any good way to do something like this?
    v
    • 2
    • 6
  • g

    Giuseppe Barbieri

    02/12/2025, 4:42 PM
    I backed a docker image with gradle, but whenever the CI run
    ./gradlew build
    it keeps downloading the distro again, the structure seems to be fine
    Copy code
    $ cd ${GRADLE_USER_HOME}
    $ find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
    .
     |-gradle.properties
     |-init.d
     | |-elara.nexus.init.gradle.kts
     |-wrapper
     | |-dists
     | | |-gradle-8.12.1-bin
     | | | |-eumc4uhoysa37zql93vfjkxy0
     | | | | |-gradle-8.12.1
     | | | | | |-init.d
     | | | | | | |-readme.txt
     | | | | | |-bin
     | | | | | | |-gradle.bat
     | | | | | | |-gradle
     | | | | | |-NOTICE
     | | | | | |-LICENSE
     | | | | | |-lib
     | | | | | | |-native-platform-osx-aarch64-0.22-milestone-27.jar
     | | | | | | |-gradle-base-services-groovy-8.12.1.jar
     | | | | | | |-gradle-base-asm-8.12.1.jar
    I also see in the logs
    ./gradlew
    deletes the right directory
    Copy code
    $ ./gradlew build
    Downloading <https://services.gradle.org/distributions/gradle-8.12.1-bin.zip>
    .............10%.............20%.............30%.............40%.............50%.............60%.............70%.............80%.............90%.............100%
    Deleting directory /home/user/.gradle/wrapper/dists/gradle-8.12.1-bin/eumc4uhoysa37zql93vfjkxy0/gradle-8.12.1
    any idea why?
    t
    v
    • 3
    • 4
  • н

    Никита Гучаков

    02/13/2025, 6:36 AM
    Hi. Is that ok that Gradle Test Workers dies on each submodule of the project or I have misconfigured it somewhere? I'm dealing with multimodule project with ~300 modules, some of them have really tiny amount of tests and I see that test workers forks after finishing a module.
  • e

    Elham Hajialigholikivi

    02/13/2025, 10:23 AM
    Hi , I am trying to update the gradle version from 6to 8.6 but I have some issues.
    s
    v
    n
    • 4
    • 14
  • a

    Arthur McGibbon

    02/13/2025, 1:35 PM
    How does Gradle prevent 2 daemons accessing the same project concurrently? Or does it not? If I run
    gradlew clean classes
    from 2 CLIs simultaneously then 1 of them will fail with missing classes issues because the other has just wiped its compilation result. I don't actually do this but I have run a CLI command at the same time as Intellij is running a build and that has caused a failure. Is there any kind of locking based on project location?
    👀 1
    v
    j
    • 3
    • 8
1...606162...102Latest