https://gradle.com/ logo
Join Slack
Channels
community-support
android
caching
checkstyle-plugin
community-news
config-avoidance
configuration-cache
contributing
declarative-gradle
dependency-management
design-specs
develocity
developer-productivity-engineering
dev-shadow-plugin
docs
dpe-summit
feed
file-system-watching
flutter
fun
general
github-integrations
gradle-build-server
gradleup
gradlex
gsoc
gsoc-2025-improving-cc
jenkins-plugin-toolchain
jobs
kotlin-dsl
linen
maven
maven-central
migrating-from-ant
migrating-from-maven
native
performance
playframework
plugin-development
problems-api
random
releases
releases-discussion
roadmap
self-promotion
website
Powered by
# community-support
  • j

    Jerome Haltom

    07/25/2025, 5:14 PM
    Greetings. I am working on a plugin. And for the time being I'm just doing it in buildSrc of the main application, until I get it all worked out. But I have a situation where I need some code that is used both by the plugin, but also by an application. I thought, wouldn't it be neat to use includedBuilds for this? Make that project then dependency from both buildSrc as well as the root project. It almost works. It builds. The buildSrc project can actually access the classes. However the main project cannot. This supposed to work?
    v
    • 2
    • 2
  • c

    Caleb Cushing

    07/29/2025, 1:14 AM
    what project structure could I use to test a version catalog that I'm creating? not in toml format, one to publish. I want to test that the accessors are created properly and that I can actually download the jars. (note: currently having a laugh as an AI bumbles through trying to make a second gradle project...)
    v
    o
    • 3
    • 9
  • a

    Andrzej Zabost

    07/30/2025, 12:16 PM
    Hi. I'm having trouble understanding the difference in plugin's behavior depending on whether a
    buildscript
    block is used or not (or, at least, that seems to be the difference). I'm sharing the post from #CJYS1DAP5 for visibility because I assume the problem may be more generic and not necessarily Android related. https://gradle-community.slack.com/archives/CJYS1DAP5/p1753877427121339
    v
    • 2
    • 53
  • j

    Jacob Tindi

    07/30/2025, 2:31 PM
    I am having trouble with running my code, it is building successful but it fails to run giving the following error:
    🗑️ 1
  • j

    Jacob Tindi

    07/30/2025, 2:33 PM
    I am having trouble with running my code, it is building successful but it fails to run giving the following error: C\Users\hp\.gradle\caches\8.11.1\transforms\2ab28fd56374bd5aaba63db5d8683fc2\transformed\fragment 1.5.7\res\values\values.xml24 <item> inner element must either be a resource reference or empty. FAILURE: Build failed with an exception.
    🧵 2
    v
    • 2
    • 1
  • c

    Colton Idle

    07/30/2025, 5:56 PM
    in android settings.gradle.kts in dependencyresolutionManagement block whats the difference between repositoriesMode.set(FAIL_ON_PROJECT_REPOS) and repositoriesMode = FAIL_ON_PROJECT_REPOS same thing?
    👀 1
    v
    j
    • 3
    • 6
  • a

    Andrew Grosner

    07/31/2025, 2:46 PM
    has anyone gotten project isolation to work in an android project? Last i checked it was blocked due to https://github.com/gradle/gradle/issues/32692 https://issuetracker.google.com/issues/402454271
    🙅‍♂️ 1
    l
    • 2
    • 3
  • e

    Eli Graber

    07/31/2025, 7:01 PM
    I have a library that provides precompiled script plugins, and some of them apply other plugins, e.g.
    Copy code
    plugins {
      id("io.gitlab.arturbosch.detekt")
    }
    After updating to 9.0.0, building the library fails with
    Copy code
    Plugin [id: 'io.gitlab.arturbosch.detekt'] was not found in any of the following sources:
    
    - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
    - Included Builds (No included builds contain this plugin)
    - Plugin Repositories (plugin dependency must include a version number for this source)
    Anyone know if this new failure is intentional or a regression?
    t
    l
    • 3
    • 4
  • c

    Colton Idle

    08/01/2025, 2:19 AM
    Why can't I find this merged PR https://github.com/gradle/gradle/pull/33497 in https://docs.gradle.org/9.0.0/userguide/best_practices.html am i missin something here?
    v
    • 2
    • 1
  • s

    Sebastian Schuberth

    08/01/2025, 6:56 AM
    Regarding the new best practices guide, would it be possible to get some (AI-based 😅 ) Gradle plugin that takes this information and checks the build files against it?
    ➕ 1
    c
    v
    l
    • 4
    • 5
  • s

    Sebastian Schuberth

    08/01/2025, 7:26 AM
    After migrating to Gradle 9, I get a build error, but only when building my project inside a Docker contain as part of a GitHub Action, see this. The error message is `Configuring project 'utilstest-utils' without an existing directory is not allowed. The configured projectDirectory '/home/ort/src/ort/utils/test' does not exist, can't be written to or is not a directory.`Locally, on a native machine, the build works fine. Also, the CI build in Docker works fine with Gradle 8.14.3. Any idea what change in Gradle 9 is causing this?
    v
    p
    • 3
    • 37
  • n

    Niels Doucet

    08/01/2025, 7:56 AM
    After migrating to Gradle 9, we're experiencing issues with the sonarqube plugin:
    Copy code
    Execution failed for task ':sonar'.
    > Resolution of the configuration ':project-submodule:testCompileClasspath' was attempted without an exclusive lock. This is unsafe and not allowed.
    Details in 🧵
    v
    • 2
    • 7
  • a

    Andrew Grosner

    08/01/2025, 2:56 PM
    ive noticed consistently that Android studio leaks gradle daemons pretty often, nearly daily. I typically have to kill daemons or restart the IDE then kill the daemon to get rid of leaked ones. Is this a known issue? its especially egregious since we need 24GB+ of ram to build our app in reasonable amount of time. so end up with a "BUSY" daemon thats not actually compiling, then Android studio / gradle spins up a new daemon that causes memory pressure with the other one until i kill and sometimes need to restart the IDE
    m
    v
    +2
    • 5
    • 26
  • j

    John Svensson

    08/01/2025, 3:04 PM
    Hi Gradle Community! I would be grateful for some help on applying one convention plugin inside another one while using in included "build-logic" build and the type-safe accessors from
    LibrariesForLibs
    . Will post in thread to not clutter the main channel.
    v
    • 2
    • 11
  • q

    Q-MEDİKAL LAB

    08/02/2025, 6:16 AM
    👋 Hello, team!
    👋 1
  • q

    Q-MEDİKAL LAB

    08/02/2025, 6:16 AM
    FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':flutter_secure_storage'.
    Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
    > Namespace not specified. Specify a namespace in the module's build file: C:\Users\traco\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_secure_storage-7.0.1\android\build.gradle. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace. If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant. * 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.
    d
    v
    • 3
    • 2
  • a

    Anmol

    08/05/2025, 8:17 AM
    FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'expo dev launchercompileReleaseWithDevLauncherKotlin'.
    A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
    > Compilation error. See log 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.
    n
    v
    • 3
    • 6
  • v

    Vladimir Sitnikov

    08/05/2025, 8:30 AM
    The following error is very sad to deal with:
    Copy code
    java.lang.NoClassDefFoundError: org/gradle/util/VersionNumber
    Well, Gradle had
    VersionNumber
    class for quite some time, and it is sad Gradle 9 broke backward compatibility with plugins which still use
    VersionNumber
    from
    org.gradle.util
    I wonder what are the benefits for Gradle to drop the class. My guess is it does not require much efforts to support. It would be so much better if Gradle used something like
    @Deprecated(level=Hidden)
    instead of dropping the class.
    ➕ 1
    m
    a
    +2
    • 5
    • 87
  • p

    Pratikshit singh

    08/05/2025, 10:11 AM
    hey
    👋 2
  • b

    blubb

    08/05/2025, 2:02 PM
    When I have a conventional plugin and publish it into a local maven repository. Another project wanting to use that plugin needs to include it as dependency, right?
    v
    • 2
    • 56
  • x

    Xeno

    08/05/2025, 3:54 PM
    👋 Hello, team! I am developing a Gradle plugin designed to resolve dependencies using system artifacts. The plugin is initiated from an init script. I have implemented dependency resolution for plugins in the
    beforeSettings
    phase and for regular dependencies in the
    projectsLoaded
    phase. However, I have been struggling for a while to determine in which hook I should add transitive dependencies for plugins. For example, the plugin (
    com.gradleup.shadow
    ) has the following dependencies: -
    org.vafer:jdependency
    -
    org.apache.logging.log4j:log4j-core
    -
    org.codehaus.plexus:plexus-xml
    -
    org.codehaus.plexus:plexus-utils
    -
    commons-io:commons-io
    -
    org.jdom:jdom2
    -
    org.apache.ant:ant
    All of these dependencies are present in my system, including their artifacts and POM files. Currently, my plugin is unable to resolve transitive dependencies for plugins because I am unsure about the correct hook to use for adding them to the configuration and the precise method to do so. As a result, the build process fails with an error. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':shadowJar'.
    org/vafer/jdependency/Clazzpath
    * Try:
    Run with --stacktrace option to get the stack trace.
    Run with --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 1s 5 actionable tasks: 1 executed, 4 up-to-date and if I add this to build.gradle
    Copy code
    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath("org.apache.ant:ant:1.10.14")
            classpath("org.ow2.asm:asm-commons:9.8")
            classpath("org.ow2.asm:asm:9.8")
            classpath("commons-io:commons-io:2.18.0")
            classpath("org.vafer:jdependency:2.13")
        }
    }
    then I get BUILD SUCCESSFUL in 1s 6 actionable tasks: 6 up-to-date
    Copy code
    Moreover, both attempts were made in an environment without Internet access and with a cleared cache.
    
    Please tell me how to correctly add such dependencies to the configuration using the API so that they fall into the plugin classpath, I will be very grateful
    v
    j
    • 3
    • 34
  • l

    Leroy Anon

    08/05/2025, 4:15 PM
    I am looking for a consultant to help pass a Unity Cloud gradle build... after upgrading a Unity project from 2020.3, to 2021.3. Hope I am in the right channel. 👋
    v
    • 2
    • 3
  • a

    Arthur McGibbon

    08/05/2025, 4:22 PM
    Since moving to Gradle 9, my bash scripts in
    src/main/dist/bin
    lose their exec attribute when being copied into the archive by the distribution plugin. That's a bug isn't it?
    a
    v
    • 3
    • 7
  • a

    Adam

    08/06/2025, 2:09 PM
    If I have two tasks:
    taskB
    depends on
    taskA
    , but
    taskB
    is disabled. When I run
    gradle taskB
    , why does Gradle still run
    taskA
    ? Shouldn't it also be skipped?
    Copy code
    val taskA by tasks.registering {
      doLast {
        println("running $path")
      }
    }
    
    val taskB by tasks.registering {
      enabled = false
      onlyIf { false }
      dependsOn(taskA)
      doLast {
        println("running $path")
      }
    }
    Copy code
    ./gradlew taskB
    > Task :taskA
    running :taskA
    > Task :taskB SKIPPED
    BUILD SUCCESSFUL in 175ms
    v
    x
    • 3
    • 7
  • p

    Philipp Nowak

    08/08/2025, 7:14 AM
    Hi guys, I'm trying to benchmark a gradle build with gradle-profiler using a scenario file containing 2 scenarios. One should use a property from gradle.properties setting it to
    false
    and the other one to
    true
    to see the impact. Is that possible? I thought about using
    system-properties
    but it doesn't seem to be the right one here since it translates to the
    -D
    arg instead of
    -P
    v
    a
    • 3
    • 8
  • l

    Lucas Holden

    08/09/2025, 6:17 AM
    When using attribute-aware variant selection with two configurations extending one another, how do you make the extending configurations use the same variant as the parent?
    Copy code
    dependencies {
      myCfg(project(":common"))
    }
    configurations {
      myCfg {
        canBeResolved = true
        canBeConsumed = false
        attributes {
          attribute(MyAttributes.PLATFORM, "thisPlatform")
          attribute(MyAttributes.SOURCETYPE, "main")
        }
      }
    
      // both of these somehow use :common's default export, which is a different jar to the one myCfg consumes
      compileClasspath.extendsFrom(myCfg)
      runtimeClasspath.extendsFrom(myCfg)
    }
    p
    v
    • 3
    • 10
  • m

    Mohamed Abderraouf ZOUAID

    08/09/2025, 5:49 PM
    Hello, I was working with flutter perfectly, than I cloned a gitlab project on my laptop, then it required me to upgrade flutter version to 3.32.8, after the upgrad, every flutter project cant run and build and shows this error
    Copy code
    Picked up JAVA_TOOL_OPTIONS: -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
    > Cannot query the value of this provider because it has no value available.
    
    * 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 1m 25s
    Running Gradle task 'assembleDebug'...                             88.4s
    Error: Gradle task assembleDebug failed with exit code 1
    anyone can help me please?
    v
    e
    • 3
    • 4
  • e

    edward ambroce

    08/09/2025, 6:42 PM
    I'm encountering the same problem
    v
    • 2
    • 1
  • m

    Martin

    08/09/2025, 9:28 PM
    Can I silence this?
    Consider enabling configuration cache to speed up this build
    ✅ 1
    a
    • 2
    • 4
  • l

    Lucas Holden

    08/10/2025, 7:16 PM
    How do you set a plugin version as "changing" in the Plugins DSL, so that Gradle re-evaluates it even if the version number hasn't increased?
    v
    • 2
    • 1