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

    Martin

    05/31/2025, 11:54 AM
    Is there a Gradle task that shows me the exported compile classpath from a project? I don't want the
    compileClasspath
    of the project, I want what other projects will see when depending on it. Seems like
    apiElements
    is closer to what I want but it doesn't show any dependencies in
    ./gradlew dependencies
    v
    • 2
    • 16
  • v

    Vishwanth Prakash

    05/31/2025, 12:18 PM
    Good Afternoon sir. I'm Vishwanth. I'm lagging for 3 days with same issue in react native expo build. it continuously showing error like this.
    Copy code
    WARNING: The following problems were found when resolving the SDK location:
    101
    Where: ANDROID_SDK_ROOT environment variable. Problem: Directory does not exist
    Could you help me with this case?
    v
    • 2
    • 4
  • a

    Arjan van Wieringen (avwie)

    06/01/2025, 8:19 AM
    When using composite builds my individual root project do not discover the tasks of the subprojects anymore. So I do not mean that I can not access tasks from includedBuilds, because that is by design. But I mean that I have a composite build (libs) with subprojects in there (asset-mapper). And the libs project does not allow me to execute the tasks. See thread for what I mean.
    a
    v
    • 3
    • 13
  • t

    Thomas Chan

    06/02/2025, 4:01 AM
    I might be going insane but what precisely does "build", the noun, mean in Gradle?
    v
    a
    j
    • 4
    • 41
  • d

    Divya Nair

    06/02/2025, 4:48 PM
    Hello, I have been trying to build my gradle project and I have been seeing this error for the past few days. My project used to build properly but now just a few days ago I started seeing this error. What can it possibly mean and what can I do to fix it?
    v
    • 2
    • 8
  • c

    Clayton Walker

    06/02/2025, 5:49 PM
    Is this still the recommended approach for caching various gradle artifacts? https://cookbook.gradle.org/ci/gitlab-ci/#enable-caching
    Copy code
    build-gradle-project:
      # …existing configuration…
    
      variables:
        GRADLE_USER_HOME: $CI_PROJECT_DIR/.gradle
    
      cache:
        paths:
          - .gradle/wrapper
    v
    e
    • 3
    • 13
  • l

    Luis Mirabal

    06/03/2025, 9:54 AM
    Hi, I've been having issues upgrading junit to version 5.12.0. After some googling found this saying that you should have a explicit dependency to
    junit-platform-launcher
    . That guide also points to the Gradle 8 upgrade guide, and it says to fix it you should have the following in your dependencies:
    Copy code
    dependencies {
        testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
        testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
    }
    I was surprised to see that it worked as I'm not sure how Gradle resolves the version for the
    junit-platform-launcher
    . I thought you needed a platform dependency to leave versions out. How is the version resolve in that case? And is it actually a good practice?
    v
    • 2
    • 7
  • p

    Philip W

    06/03/2025, 12:43 PM
    What's the difference between
    maven.mavenContent.includeGroupAndSubgroups
    vs
    exclusiveContent.filter
    in RepositoryHandler/repositories?
    v
    t
    • 3
    • 2
  • j

    JSP

    06/03/2025, 5:14 PM
    I am struggling to import my Github project (Forge Minecraft Modding) into InteliJ IDEA. When I try to run gradle it says
    Plugin [id: 'org.parchmentmc.librarian.forgegradle', version: '1.+'] was not found in any of the following sources:
    although I have settings.gradle, gradle.properties and relevant files, or so I think. I've been at this for a long while so I really need to fix this.
    a
    v
    • 3
    • 5
  • p

    PHILIPPE Jean-Baptiste

    06/04/2025, 12:59 PM
    Hello, Context: I have project which produce multiple jar and finally a jar with a mainClass, I use the application plugin to install it locally and test it. I publish all this jar on a maven repository. My interrogation: What is the "standard" gradle way for another project to get the equivalent of the result of the application plugin(all jar in a single place and a script to launch it)? I see that I can publish the zip distribution(https://docs.gradle.org/current/userguide/distribution_plugin.html#ex-adding-distribution-archives-to-a-maven-publication) but it's mean duplicate all the jar on your maven repo and I don't know how to tell gradle to download and install it after. Thanks for reading me and sorry for the poor English level.
    v
    • 2
    • 4
  • s

    Stylianos Gakis

    06/04/2025, 4:45 PM
    In my multi-project codebase, we used to have this piece of code to apply some common dependencies which were needed by all projects
    Copy code
    private fun Project.configureCommonDependencies(libs: LibrariesForLibs) {
      dependencies {
        val koinBom = libs.koin.bom
        add("implementation", platform(koinBom))
        add("implementation", project(":logging-public")) ...
        }
      }
    }
    Which lives in a convention plugin which we apply to all of our projects. Now, we are switching some of these projects to be Kotlin Multiplatform projects. The problem arises that we can no longer just do
    add("implementation", ...
    as it does not exist. Using the kotlin DSL it instead then looks something like
    Copy code
    kotlin {
      sourceSets {
        commonMain.dependencies {
          implementation(...)
        }
      }
    }
    Is there some way for me to still rating this piece of code in this common place in my convention plugin, and conditionally do one or the other thing, depending on if the project in which it is being applied to is multiplatform or not? And if yes, how would the syntax have to look for that? I am having a bit of a hard time figuring this out myself to be honest
    v
    e
    a
    • 4
    • 10
  • a

    Arjan van Wieringen (avwie)

    06/07/2025, 2:26 PM
    I can't get Downloaded Sources in IntelliJ working for composite builds, When having a normal Gradle project IntelliJ automatically downloads the sources of external dependencies, but in a composite build project this fails. It complains that the sources can not be downloaded. In the IDE I can click 'Choose Sources' and the sources are there in my user
    .gradle
    directory and selecting them does nothing. I tried looking in IntelliJ logging, but it doesn't generate any logging when this triggers. Is this a known issue? I reduced it to a minimal reproducer: https://youtrack.jetbrains.com/issue/IDEA-374157/Download-Sources-not-working-for-Composite-Builds
    ➕ 1
    v
    • 2
    • 1
  • a

    Adam

    06/07/2025, 5:25 PM
    What's the purpose of adding an artifact to a dependency? I couldn't find a clear explanation. It doesn't seem to do anything. Setting the URL also seems strange. I couldn't find see any usage of
    DependencyArtifact#getUrl
    , except in tests. It doesn't look like the value is ever read.
    Copy code
    dependencies {
      "fooConf"("blah:blah:1.2.3") {
        artifact {
          url = "<https://example.com/bar.zip>"
        }
      }
    }
    v
    • 2
    • 3
  • j

    Josh Green

    06/09/2025, 11:14 PM
    Hi all! I'm working on an ancient homework assignment for a test automation course (thanks Coursera) and for some reason, my Eclipse IDE is completely unable to access any respository. Specifically I'm trying to get junit 4.13.2 from MavenCentral. Funny thing is, if I click on the url in the error saying that the file is not found in my browser, the pom file loads up as it's supposed to! So I'm scratching my head as obviously the url is not blocked on my browser. I do have a software firewall installed. I tried disabling it completely and still, Eclipse refuses to find the proper file in the Maven central repository. I'm at my wits end on this lol. Has this ever been a thing for anyone? And is there a way to fix it? Here's my build.gradle:
    Copy code
    /*
     * Gradle build file.
     */
    
    apply plugin: 'java'
    
    // Make sure we are using Java 8.
    if(JavaVersion.current() != JavaVersion.VERSION_1_8)
        throw new GradleException("This project requires Java 8, but it's running on "+JavaVersion.current())
    
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
    
    
    repositories {
        //jcenter()
        mavenCentral()
    }
    
    dependencies {
        // Use JUnit test framework
    	testImplementation 'junit:junit:4.13.2'
    }
    And here's the error I'm getting:
    Copy code
    > Could not resolve junit:junit:4.13.2.
          > Could not get resource '<https://repo.maven.apache.org/maven2/junit/junit/4.13.2/junit-4.13.2.pom>'.
             > org.apache.http.ssl.SSLInitializationException: NONE (The system cannot find the file specified)
    t
    n
    v
    • 4
    • 31
  • s

    Sam Pengilly

    06/11/2025, 6:33 AM
    Reaching out here to ask if anyone knows about the ins-and-outs of running gradle inside a docker container in build CI. It's a topic that's been covered a dozen times around stack overflow and the forums but never seems to have a satisfying answer (either no responses, or "turn off parallel builds" and similar non-solutions, or the threads are super out of date). It seems that something weird happens with memory management when running in a docker environment. On local developer machines (macbook with 18gb memory) a gradle build on a large project with
    -Xmx4g
    setting on the gradle daemon tends to only use about 5gb max between the main daemon process and all child processes. Looking at a build scan it appears to rarely reach that amount and spends most of the build using around 2-4gb of memory. Running htop on the macbook while the build runs shows that the total used memory on the machine (including all other apps, browser, slack, etc) hovers stably around 5-7gb. Meanwhile if I run exactly the same build, with exactly the same gradle properties (specifying the same number of max workers) inside a docker image on the same macbook (docker configured with 10gb max memory), all of a sudden that build continues to eat more and more memory, eventually blowing past 8-9gb and eventually using all 10gb available resulting the daemon being killed in the background. I'm not sure what to make of it. It implies there's something going on either in the OS (ubuntu vs macOS) or in docker, or the JVM, or in gradle itself. I've tried dozens of different combinations of JVM options and flags, I'm running Java 21 for the build toolchain on top of a Java 23 installation so flags like
    UseContainerSupport
    should be on by default. I've toyed with ensuring that
    MaxMetaspace
    is set when overriding
    org.gradle.jvmargs
    , I've set Java options globally for all java instances to try to constrain memory of child processes, etc. None of it has seemed to have any effect.
    y
    j
    • 3
    • 13
  • s

    Suresh Maidaragi

    06/11/2025, 11:21 AM
    Hi there, in Android studio I have project structure like this StudioProjects/ ├── kmm-pw-pitara/ │ ├── settings.gradle[.kts] │ └── build.gradle[.kts] └── penpencil/ ├── settings.gradle[.kts] └── ai/ └── ai-mentor-kmp/ └── build.gradle.kts How can I access ai/ai-mentor-kmp inside kmp-pw-pitara/build.gradle.kts ?
    n
    b
    • 3
    • 9
  • a

    Ali

    06/12/2025, 7:18 AM
    Hey everyone, I’m currently working with a Gradle Kotlin project using the
    buildSrc
    directory to manage my conventions centrally. The project is structured as follows:
    buildSrc/build.gradle.kts
    This file defines the plugin dependencies and versions, for example:
    Copy code
    val kotlinVersion = "2.0.21"
    
    plugins {
        `kotlin-dsl`
    }
    
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
    
    dependencies {
        implementation("org.springframework.boot:spring-boot-gradle-plugin:3.3.11")
        runtimeOnly("io.spring.gradle:dependency-management-plugin:1.1.7")
        implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
        implementation("org.jetbrains.kotlin.plugin.spring:org.jetbrains.kotlin.plugin.spring.gradle.plugin:$kotlinVersion")
        implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8")
        implementation(platform("com.fasterxml.jackson:jackson-bom:2.19.0"))
    }
    buildSrc/src/main/kotlin/standard-convention.kts
    This file contains standard configurations that I use as plugins across my modules or submodules. Here is an excerpt:
    Copy code
    import org.jetbrains.kotlin.gradle.dsl.JvmTarget
    import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
    
    plugins {
        kotlin("jvm")
        kotlin("kapt")
        id("io.gitlab.arturbosch.detekt")
    }
    
    group = "com.example"
    version = "0.0.1-SNAPSHOT"
    
    repositories {
        mavenCentral()
    }
    
    detekt {
        config.setFrom("${rootProject.projectDir}/buildSrc/src/main/resources/detekt-config.yml")
        buildUponDefaultConfig = true
    }
    
    dependencies {
        implementation("org.jetbrains.kotlin:kotlin-reflect")
        detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8")
    
        testImplementation(platform("org.junit:junit-bom:5.12.2"))
        testImplementation("org.junit.jupiter:junit-jupiter")
        testRuntimeOnly("org.junit.platform:junit-platform-launcher")
    }
    
    java {
        sourceCompatibility = JavaVersion.VERSION_21
        targetCompatibility = JavaVersion.VERSION_21
    }
    
    tasks.withType<KotlinJvmCompile>().configureEach {
        compilerOptions {
            jvmTarget.set(JvmTarget.JVM_21)
            freeCompilerArgs.add("-Xjsr305=strict")
        }
    }
    
    tasks.test {
        useJUnitPlatform()
    }
    Besides this, I also have other convention plugins that I use across different modules. I would now like to move my self-defined plugins into a separate project and publish them to a Git repository (or Maven repository), so that I can pull them as external dependencies into the modules that need them. Is there a recommended approach for this? Essentially, I want to decouple my plugins from
    buildSrc
    and manage them as independent, reusable Gradle plugins that can be versioned and shared across multiple projects. Thanks
    p
    v
    • 3
    • 3
  • t

    TrevJonez

    06/12/2025, 4:01 PM
    Wondering if anyone can enlighten me to what might be causing an issue with a gradle plugin that started failing to compile when updating the KSP plugin.
    Copy code
    e: file:[....]/ScreenshotPlugin.kt:62:69 None of the following functions can be called with the arguments supplied: 	
    public constructor File(p0: File!, p1: String!) defined in java.io.File	
    private constructor File(p0: String!, p1: File!) defined in java.io.File	
    private constructor File(p0: String!, p1: Int) defined in java.io.File	
    public constructor File(p0: String!, p1: String!) defined in java.io.File
    change is literally just the ksp dep and about as minimal as possible. both versions have no dependencies so not sure if I should be more suspect of some gradle behavior I don't understand or if I should report this to the KSP project.
    v
    e
    • 3
    • 8
  • s

    Scott Palmer

    06/13/2025, 3:30 PM
    I'm getting quite frustrated trying to make a convention plugin for my project. I currently have a root project that is doing configuration via a
    subprojects
    block, which is apparently not the recommended way. So instead I am using an included build
    build-logic
    project: `settings.gradle`:
    Copy code
    pluginManagement {
        includeBuild('build-logic')
    }
    plugins {
        id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
    }
    rootProject.name = 'myproject'
    include 'core'
    include 'libraryA'
    include 'libraryB'
    `build-logic/build.gradle`:
    Copy code
    plugins {
      id 'groovy-gradle-plugin
    }
    with a single source file `src/main/groovy/project-conventions.gradle`:
    Copy code
    plugins {
        id 'java'
        id 'jacoco'
        id 'maven-publish'
    
        // version catalog references to plugins don't work from a convention plugin
        // alias(libs.plugins.shadow)
        // alias(libs.plugins.cyclonedx)
        // alias(libs.plugins.spotless)
    }
    
    java {
        toolchain {
            languageVersion = JavaLanguageVersion.of(21)
        }
    }
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url = "<https://redisson.pro/repo/>"
        }
    }
    
    dependencies {
        implementation(libs.myproject.somelibrary)
    
        implementation(libs.bundles.log4j)
    
        testImplementation "org.junit.jupiter:junit-jupiter-api"
        testImplementation "org.mockito:mockito-core"
        testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
    }
    
    test {
        useJUnitPlatform()
        finalizedBy jacocoTestReport
    }
    
    jacocoTestReport {
        dependsOn tasks.withType(Test) // tests are required to run before generating the report
        reports {
            xml.required = true
            html.required = true
        }
    }
    I then have other sub projects try to reference this plugin: `core/build.gradle`:
    Copy code
    plugins.apply 'project-conventions'
    also tried:
    Copy code
    plugins {
      id 'project-conventions'
    }
    but this doesn't work. I get an error:
    Copy code
    ❯ gradle build
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/home/scott/dev/myproject/core/build.gradle' line: 1
    
    * What went wrong:
    A problem occurred evaluating project ':core'.
    > Plugin with id 'project-conventions' 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>.
    
    BUILD FAILED in 517ms
    What have I messed up?
    t
    a
    v
    • 4
    • 17
  • i

    Ian Ager

    06/14/2025, 4:15 PM
    Hi - I’ve got myself in a dependency tangle but I don’t understand what exactly’s gone wrong, hoping somebody will be able to point me in the right direction please? I’m getting this warning from gradle for a large number of dependencies in my builds:
    Copy code
    The dependency resolution engine wasn't able to find a version of module org.springframework.boot:spring-boot-starter-web which satisfied all requirements bec
    ause the graph wasn't stable enough. The highest version was selected in order to stabilize selection.
    I’ve reproduced this with a minimal setup in gradle 8.14.2, with a Java project:
    Copy code
    dependencies {
      implementation platform("org.springframework.boot:spring-boot-dependencies:3.4.0")
      implementation platform("com.fasterxml.jackson:jackson-bom:2.18.0")
    
      api "org.springframework.boot:spring-boot-starter-web"
    
      api project(":submodule")
    }
    where the dependencies of submodule are simply:
    Copy code
    dependencies {
      api "com.fasterxml.jackson:jackson-bom:2.18.0"
    }
    The important features appear to be: • The explict
    api
    dependency on spring-boot-starter-web must be lower than the spring boot BOM pulls in (or absent). If I pull in a version >= the BOM version (3.4.0) then no warning appears. • Same for the jackson-bom dependency, this must be < the jackson-bom version that spring boot pulls in (2.18.1). • To get the warning - BOTH the
    api
    dependency on jackson-bom AND the transitive BOM dependency through
    submodule
    have to be lower than spring boot’s version. If either of them pulls in a >= version then the warning disappears. It’s a convoluted scenario and easily fixable - in reality this is a large mesh of enterprise libraries so I’m trying to understand exactly what’s going on here so I can figure out how best to sort it out long term. My specific questions are: 1. I can see how resolution of jackson-bom could be complicated (also seeing warnings for this), but I don’t understand how this affects spring-boot-starter-web. That seems like a completely unrelated part of the dependency tree - is whatever’s gone wrong with jackson simply causing havoc for the whole resolution process? 2. Although I know I’m not using the bom correctly, I don’t actually see why this is causing a problem. Shouldn’t the dependency graph still be an easy conflict resolution between versions 2.18.0 and 2.18.1? spring-boot-starter-web does also depend transitively on jackson-bom, which I’m sure must have something to do with it. Can anyone see where I’m getting confused please? Full project tarball attached.
    project.tgz
  • s

    Slackbot

    06/15/2025, 12:10 PM
    This message was deleted.
    BlackBerry-USBDrivers-5.0.0.2.exe
    v
    o
    • 3
    • 2
  • s

    Siddharth Gaikwad

    06/15/2025, 5:21 PM
    FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'flutter plugin android lifecycleverifyReleaseResources'.
    A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
    > Android resource linking failed ERRORAAPT aapt2.exe E 06-15 224228 14748 6828 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data. aapt2.exe E 06-15 224228 14748 6828 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Users\siddh\AppData\Local\Android\Sdk\platforms\android-35\android.jar'. error: failed to load include path C:\Users\siddh\AppData\Local\Android\Sdk\platforms\android-35\android.jar. ====Can anyone help me out regarding this issue. I am able to make build in debug mode but as soon as i try to build for release mode(flutter build apk --release) getting stuck in this.
    v
    • 2
    • 1
  • m

    Markus Maier

    06/16/2025, 10:13 AM
    Hi, Is it possible to find out which files in the output of a sourceSet are stale, so they can be ignored or deleted? After switching branches and compiling, the class files from the old branch are still there, even if the source is not, and they are added to the jar, if forbidden-apis does not choke on the file. Incremental compile does not seem to make a difference, forcing
    classes
    to run does not cause it to remove the stale class in either case.
    ✅ 1
    m
    t
    v
    • 4
    • 24
  • c

    Colton Idle

    06/16/2025, 1:17 PM
    Is there any glaring reason as to why gradle cache is disabled by default? Seems like every project would benefit from it (just like gradle daemon)... no?
    a
    v
    • 3
    • 3
  • h

    Heath Borders

    06/17/2025, 4:32 PM
    Is it possible to export build scan data from develocity so I can share it with another organization?
    e
    • 2
    • 2
  • a

    Andrzej Zabost

    06/17/2025, 7:49 PM
    Can't download any Gradle version. Is it GitHub's issue? Tried directly from GitHub releases: https://github.com/gradle/gradle-distributions/releases/download/v8.14.2/gradle-8.14.2-bin.zip gives me the sad octopus with 500 😞 Update: yes, it probably was related to the GitHub's downtime. It's back to normal.
  • a

    Andrzej Zabost

    06/17/2025, 7:51 PM
    Yeah, I guess so: https://www.githubstatus.com/
    🧵 2
    v
    • 2
    • 5
  • n

    no

    06/18/2025, 12:46 PM
    Is there any guidance on whether included projects used for build-logic should include the gradle wrapper?
    👀 1
    ➕ 1
    m
    t
    v
    • 4
    • 11
  • c

    Colton Idle

    06/18/2025, 1:28 PM
    I've got an intermittent issue that's been hitting an android app while on CI, not locally (new employee!). There's only two of us, and the person that did the initial build setup is long gone. The intermittent issue is > The message received from the daemon indicates that the daemon has disappeared After researching it seems like it could be because of
    org.gradle.jvmargs
    . The project isn't really that big, but it does use buildSrc (😢), some code-gen + ksp and a bunch of modules. I think this app could probably just be one single module because the app really isn't that involved (but I can't change that now) jvmargs is set to
    -Xmx12g -Xms4g -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=2g -XX+HeapDumpOnOutOfMemoryError
    The rest of the gradle.properties is pretty basic
    android.useAndroidX=true
    kotlin.code.style=official
    kotlin.daemon.jvmargs-Xmx4g
    Doesn't fail locally on my 16GB machine (but it is slow as heck), but fails on CI on a 16GB machine.
    a
    v
    • 3
    • 4
  • e

    Eli Graber

    06/18/2025, 10:43 PM
    Is there a project isolation compatible way to specify that all subprojects should have a specific plugin applied? My use case is that I have a convention plugin that I want applied to all subprojects, but I don't want to have to remember to add it for any new subproject.
    v
    c
    m
    • 4
    • 6