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

    Oliver Kopp

    07/11/2025, 3:28 PM
    In a clean Windows 10 Sandbox (and on macOS at one contributor) and on a Contributor on Windows 11, gradle says Shortening Java classpath [C...] and then
    Copy code
    Starting process 'command 'C:\Users\WDAGUtilityAccount\.gradle\jdks\amazon_com_inc_-24-amd64-windows.2\bin\java.exe''. Working directory: C:\Users\WDAGUtilityAccount\AppData\Local\Temp\jabref\jabgui Command: C:\Users\WDAGUtilityAccount\.gradle\jdks\amazon_com_inc_-24-amd64-windows.2\bin\java.exe --enable-native-access=ai.djl.tokenizers,ai.djl.pytorch_engine,com.sun.jna,javafx.graphics,javafx.media,javafx.web,org.apache.lucene.core --add-opens java.base/java.nio=<http://org.apache.pdfbox.io|org.apache.pdfbox.io> --add-opens java.base/jdk.internal.ref=<http://org.apache.pdfbox.io|org.apache.pdfbox.io> --add-modules jdk.incubator.vector -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders -XX:+UseZGC -XX:+ZUncommit -XX:+UseStringDeduplication -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -cp C:\Users\WDAGUtilityAccount\.gradle\.tmp\gradle-javaexec-classpath17673669193172587711.jar --module org.jabref/org.jabref.Launcher
    Successfully started process 'command 'C:\Users\WDAGUtilityAccount\.gradle\jdks\amazon_com_inc_-24-amd64-windows.2\bin\java.exe''
    Then I get
    Copy code
    Error occurred during initialization of boot layer
    java.lang.module.FindException: Module org.jabref not found
    Build 00ba7384-9696-4fa9-9223-172669a8483f is closed
    On my Windows 10 machine (no Sandbox), gradle does not call
    Shortening Java classpath
    . Can I turn off this feature? Or maybe use it for module-path?
    v
    • 2
    • 21
  • o

    Oliver Kopp

    07/11/2025, 3:51 PM
    List.of() should be Java 17, but why is the symbol not found at gradle build - gradle 9 is JDK17+?! Compiling with toolchain 'C:\Users\koppor\.jdks\corretto-17.0.2'. Compiling with JDK Java compiler API. C\git repositories\gradle\subprojects\core\src\main\java\org\gradle\process\internal\JavaExecHandleBuilder.java435: error: cannot find symbol return List.of("@" + argsFile.getAbsolutePath()); ^ symbol: method of(String) location: interface List 1 error Maybe I am reading https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html#of() wrong?!
    🧵 1
    v
    t
    • 3
    • 2
  • b

    Ben Berman

    07/11/2025, 6:06 PM
    my experience authoring fixes for gradle has been extremely good! the only pain point is automatic toolchain management is flakey on macos.
  • i

    Ivan CLOVIS Canet

    07/13/2025, 8:24 AM
    What is the correct way to take a path as task input? I often have tasks that create a specific file. That file is therefore an output of the task, but the user should be able to configure where it is placed. If I use
    Copy code
    @get:InputFile
    abstract val file: RegularFileProperty
    then Gradle tracks its state, which doesn't make sense since the file doesn't exist yet. I've seen
    Copy code
    @get:Input
    abstract val file: Property<String>
    used, which does work, but that's not nice to use when configuring a task.
    p
    t
    m
    • 4
    • 10
  • k

    Kelvin Chung

    07/14/2025, 1:10 PM
    I currently have a problem with the jacoco plugin integrating with the Kotlin multiplatform plugin. Right now, I have this:
    Copy code
    val jacocoJvmTestReport by tasks.registering(JacocoReport::class) {
      sourceDirectories.from(kotlin.sourceSets.commonMain.map { it.kotlin })
      sourceDirectories.from(kotlin.sourceSets.jvmMain.map { it.kotlin })
    }
    However, the generated report can't seem to find the
    jvmMain
    sources, only the
    commonMain
    sources. Any idea on why that could be?
  • i

    Ishan Sharma

    07/15/2025, 2:38 AM
    Hello, I am using intelliJ to make a kotlin project, and I have selected gradle as my build tool. When I run the file normally, like in the first picture, everything works, fine, but when I click Ctrl 2 times to run the "gradle run" command, I get the error: Process 'command 'C:\Users\UserName\.jdks\openjdk-24.0.1\bin\java.exe'' finished with non-zero exit value 1. To get a bit more insight, I ran "gradle run --scan", and then the terminal prints what it's supposed to print, which is "Please enter true or false: ", after which it expects keyboard input from the user. However, this is what's printed in the terminal: Please enter true or false: 2 actionable tasks: 2 executed Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Use defined at https://gradle.com/help/legal-terms-of-use. Do you accept these terms? [yes, no] Exception in thread "main" java.util.NoSuchElementException: No line found at java.base/java.util.Scanner.nextLine(Scanner.java:1677) at MainKt.main(Main.kt:340) at MainKt.main(Main.kt) FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':run'.
    Process 'command 'C:\Users\UserName\.jdks\openjdk-24.0.1\bin\java.exe'' finished with non-zero exit value 1
    would anyone have any idea why this is happening? Why does it give this error but when I run the file normally, it works?
    ✅ 1
    v
    • 2
    • 4
  • a

    Anwar Parker

    07/15/2025, 7:04 AM
    Hi all 👋
  • a

    Anwar Parker

    07/15/2025, 7:05 AM
    Has anyone experienced this issue with Gradle 8.14.3?
    🧵 1
  • a

    Anwar Parker

    07/15/2025, 7:05 AM
    Copy code
    > Timeout waiting to lock Compressed Files Expansion Cache (/var/jenkins/workspace/core/.gradle/8.14.3/expanded). It is currently in use by another Gradle instance.
      Owner PID: 4814
      Our PID: 3262
      Owner Operation: 
      Our operation: 
      Lock file: /var/jenkins/workspace/core/.gradle/8.14.3/expanded/expanded.lock
    🧵 1
    v
    • 2
    • 8
  • i

    Ice Man

    07/15/2025, 8:48 AM
    hello everyone i am getting following error Error resolving plugin [id: 'com.facebook.react.settings']
    A problem occurred configuring project ':gradle-plugin'.
    > A build operation failed. Could not move temporary workspace (C:\Users\HP\.gradle\caches\8.13\transforms\4515da6671b69fb128505938dbdb32ed-381b8acb-5c26-4710-b485-708106405f2e) to immutable location (C:\Users\HP\.gradle\caches\8.13\transforms\4515da6671b69fb128505938dbdb32ed) > Could not move temporary workspace (C:\Users\HP\.gradle\caches\8.13\transforms\4515da6671b69fb128505938dbdb32ed-381b8acb-5c26-4710-b485-708106405f2e) to immutable location (C:\Users\HP\.gradle\caches\8.13\transforms\4515da6671b69fb128505938dbdb32ed) does anyone know how to fix it i am stuck ;//
    v
    • 2
    • 1
  • j

    Jan

    07/15/2025, 11:04 AM
    Hi, not sure if this even belongs here, but does anyone have experience with Gradle downloads in a corporate environment (on Azure Virtual Desktop)? Whenever I sync my freshly checked out Android project, it tries to download Gradle. But I keep getting
    FileNotFoundException
    for
    $HOME/.gradle/wrapper/dists/gradle-8.11.1-bin/xxxxx/gradle-8.11.1-bin.zip
    and when I look into that folder there's only a
    .lck
    and
    .part
    files. I can actually download the ZIP in the browser, so access isn't entirely blocked.
    v
    e
    • 3
    • 6
  • m

    melix

    07/17/2025, 1:31 PM
    Hi! We're hunting down Gradle 9 deprecations, but there's one I don't understand why it's happening.
    v
    • 2
    • 17
  • s

    Scott Palmer

    07/17/2025, 3:17 PM
    I have a GitHub Action running a build that happens to be configured to start the build with JDK 17, it is shared among a few projects. I have a project that needs JDK 21 and uses the foojay-resolver combined with specifying the toolchain in the build file.. this is failing though. It seems that my Kotlin-based convention plugin that is added as an included is still trying to run with JDK 17. ./build-logic/settings.gradle.kts:
    Copy code
    plugins {
        id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
        id("dev.panuszewski.typesafe-conventions") version "0.7.3"
    }
    ./build-logic/build.gradle.kts:
    Copy code
    plugins {
        `kotlin-dsl`
    }
    
    kotlin {
        jvmToolchain(21)
    }
    
    repositories {
        mavenCentral()
        gradlePluginPortal()
    }
    
    dependencies {
        implementation(libs.commons.lang3)
    }
    ./settings.gradle:
    Copy code
    plugins {
        id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
    }
    // This is to propagate the backendPlatformVersion property to the build-logic convention plugin
    gradle.beforeProject { project ->
        if (project.hasProperty('backendPlatformVersion')) {
            System.setProperty('backendPlatformVersion', project.backendPlatformVersion)
        }
    }
    rootProject.name = 'main-project'
    includeBuild("build-logic")
    include 'sub-project-1'
    include 'sub-project-2
    include 'sub-project-3'
    When I build with JAVA_HOME pointing to JDK 17:
    Copy code
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':sub-project-1'.
    > Could not resolve all dependencies for configuration 'classpath'.
       > Could not resolve project :build-logic.
         Required by:
             project :sub-project-1
          > Dependency requires at least JVM runtime version 21. This build uses a Java 17 JVM.
    Shouldn't the resolver plugin cause the build to use JDK 21?
    e
    v
    • 3
    • 8
  • m

    Mike Wacker

    07/17/2025, 11:42 PM
    How would you add a multi-line property to
    ~/.gradle/gradle.properties
    (e.g., in-memory GPG key)?
    e
    v
    • 3
    • 6
  • s

    Slackbot

    07/18/2025, 4:39 AM
    This message was deleted.
    m
    • 2
    • 1
  • s

    Simon Marquis

    07/18/2025, 11:42 AM
    👋 Hi, I'm trying to understand what is exactly happening in the following situation, and why it triggers an error. I'll take the nowinandroid project as a base. It has a
    build-logic
    directory which contains convention plugins that is add to the main build with
    Copy code
    pluginManagement {
        includeBuild("build-logic")
    }
    Everything works great, until I add a settings plugin (
    Plugin<Settings>
    ) that I try to apply on the main build. The plugin is correctly applied since we can see the generated log, but the build fails right after, with a weird message about corrupted cache:
    Copy code
    * What went wrong:
    An exception occurred applying plugin request [id: 'nowinandroid.android.application']
    > Failed to apply plugin 'nowinandroid.android.lint'.
       > Type com.android.build.api.dsl.ApplicationExtension not present
    
    ....
    ....
    Caused by: java.lang.TypeNotPresentException: Type com.android.build.api.dsl.ApplicationExtension not present
    	at org.gradle.api.reflect.TypeOf.captureTypeArgument(TypeOf.java:299)
    	at org.gradle.api.reflect.TypeOf.<init>(TypeOf.java:96)
    	at AndroidLintConventionPlugin$apply$lambda$0$$inlined$configure$1.<init>(TypeOfExtensions.kt:28)
    	at AndroidLintConventionPlugin.apply(AndroidLintConventionPlugin.kt:52)
    	at AndroidLintConventionPlugin.apply(AndroidLintConventionPlugin.kt:25)
    	at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:55)
    	at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51)
    	at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:190)
    	at org.gradle.api.internal.plugins.DefaultPluginManager.access$100(DefaultPluginManager.java:54)
    ....
    ....
    Caused by: java.lang.ClassNotFoundException: com.android.build.api.dsl.ApplicationExtension
    	at org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader.findClass(VisitableURLClassLoader.java:187)
    (I can share the full stacktrace if needed) Here is the corresponding code: https://github.com/android/nowinandroid/pull/1908/files
    👀 1
    v
    • 2
    • 22
  • v

    Vladimir Sitnikov

    07/20/2025, 6:23 AM
    What is the way to create a bom (java-platform) so it does not require duplicating the list of “published” projects? Imagine I have projects
    :core
    and
    :lib
    , and
    :test-fixtures
    . Imagine I want publishing a platform that would align the versions of
    :core
    and
    :lib
    . I do not publish
    :test-fixtures
    and I use it for testing only, so I do not want including it to the bom. Of course, I can list
    :bom
    dependencies manually, however, it would be prone to errors as I might forget adding a module to the bom when adding a new module. I use convention plugins to configure the publication for
    :core
    and
    :lib
    modules, so I would like to configure
    :bom
    automatically for all the published projects. Can I somehow do that? I see JUnit uses
    rootProject.extra
    for storing the list of projects in a bom, however, it looks like it duplicates the configuration: • firstly, it list the projects in root project extra • secondly, the relevant subprojects have their publication configurations The configurations could deviate. For example, a new module could be added without updating root project extra. Is
    rootProject.extra
    the best we can have for now? Is it safe for configuration-cache/isolated-projects?
    v
    • 2
    • 5
  • a

    Ahmed Hasan

    07/20/2025, 8:21 AM
    Hi Team, I have defined few internal repos in the repositories section of my build.gradle. and I want to know the source repo of each dependency being downloaded. how to do that? I tried build --debug but didn't find the information. my gradle version is 8.9. Any help would be appreciated. Thanks
    v
    • 2
    • 3
  • s

    Samuel Franklin

    07/21/2025, 8:35 PM
    Hi guys, i got this problem, i can't fix this, so i went to get help to you
    v
    • 2
    • 1
  • w

    Wai Han

    07/22/2025, 1:59 AM
    can someone help me with this build error that i'm facing?
    Configuration on demand is an incubating feature.
    > Configure project :vector-app
    WARNING:BuildType(nightly): resValue 'launcher_background' value is being replaced.
    WARNING:API 'ApkVariantOutput.getVersionCodeOverride()' is obsolete and has been replaced with 'VariantOutput.versionCode()'.
    It will be removed in version 7.0 of the Android Gradle plugin.
    Gradle Properties must be used to change Variant information.
    For more information, see <https://d.android.com/r/tools/use-properties>.
    To determine what is calling ApkVariantOutput.getVersionCodeOverride(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
    ABI arm64-v8a  -> VersionCode = 40104362
    ABI armeabi-v7a     -> VersionCode = 40104361
    ABI null    -> VersionCode = 40104360
    ABI x86     -> VersionCode = 40104363
    ABI x86_64   -> VersionCode = 40104364
    ABI arm64-v8a  -> VersionCode = 40104362
    ABI armeabi-v7a     -> VersionCode = 40104361
    ABI null    -> VersionCode = 40104360
    ABI x86     -> VersionCode = 40104363
    ABI x86_64   -> VersionCode = 40104364
    ABI arm64-v8a  -> VersionCode = 40104362
    ABI armeabi-v7a     -> VersionCode = 40104361
    ABI null    -> VersionCode = 40104360
    ABI x86     -> VersionCode = 40104363
    ABI x86_64   -> VersionCode = 40104364
    ABI arm64-v8a  -> VersionCode = 40104362
    ABI armeabi-v7a     -> VersionCode = 40104361
    ABI null    -> VersionCode = 40104360
    ABI x86     -> VersionCode = 40104363
    ABI x86_64   -> VersionCode = 40104364
    ABI arm64-v8a  -> VersionCode = 40104362
    ABI armeabi-v7a     -> VersionCode = 40104361
    ABI null    -> VersionCode = 40104360
    ABI x86     -> VersionCode = 40104363
    ABI x86_64   -> VersionCode = 40104364
    ABI arm64-v8a  -> VersionCode = 40104362
    ABI armeabi-v7a     -> VersionCode = 40104361
    ABI null    -> VersionCode = 40104360
    ABI x86     -> VersionCode = 40104363
    ABI x86_64   -> VersionCode = 40104364
    FAILURE: Build failed with an exception.
    * What went wrong:
    Could not determine the dependencies of task ':matrix-sdk-android:javaPreCompileDebug'.
    > Could not resolve all task dependencies for configuration ':matrix-sdk-android:_agp_internal_javaPreCompileDebug_kaptClasspath'.
    > Could not find dk.ilios:realmfieldnameshelper:2.0.0.
    Required by:
    project :matrix-sdk-android
    * Try:
    > Run with *--stacktrace* option to get the stack trace.
    Run with
    *--info* or *--debug* option to get more log output.
    * Get more help at
    <https://help.gradle.org>
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
    See <https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings>
    *BUILD FAILED* in 6s
    a
    n
    • 3
    • 3
  • m

    Martin

    07/22/2025, 4:33 PM
    How do I add a dependency that is defined in an included build to my
    settings.gradle.kts
    buildscript classpath? I've tried this but it doesn't work:
    Copy code
    pluginManagement {
      includeBuild("my-build")
    }
    
    buildscript {
      dependencies {
        // com.example:artifact-id is built by the `my-build` included build
        // I was expecting dependency substitution to happen here but it doesn't look like it's the case?
        classpath("com.example:artifact-id")
      }
    }
    Is there a way?
    t
    v
    • 3
    • 17
  • k

    Kelvin Chung

    07/22/2025, 9:08 PM
    Has there been any effort to improve the JaCoCo plugin wrt better supporting Kotlin's inline functions? From what I have seen, JaCoCo can be configured to do this, but such options are not exposed through Gradle. When it comes to implementing this improvement, there has been a passing of responsibilities between JaCoCo and Gradle maintainers.
    🙌 1
  • c

    Clayton Walker

    07/23/2025, 4:28 PM
    Is there a way to get Gradle to behave a bit more like the spring boot dependency-management plugin when using platform boms? Currently in spring dependency management, if you're using a bom with lib1:version1, and you add a dependency that tries to bump lib1 to version2, it will prefer version1. In Gradle, it'll completely ignore the version in the platform("bom") and let version2 upgrade.
    t
    v
    • 3
    • 8
  • g

    Gábor Török

    07/25/2025, 5:02 PM
    hi, for a while i started to see this error in one of our projects during incremental compilation of the tests:
    Copy code
    2025-07-24T19:17:24.388-0700 [INFO] [org.gradle.api.internal.tasks.compile.incremental.SelectiveCompiler] Full recompilation is required because JdkClassWriter.class could not be analyzed for incremental compilation. See the debug log for more details. Analysis took 1.717 secs.
    the problem is that this is our biggest project, and the full compilation can take up to more than a minute - which slows down iterating on problems A LOT. • enabling the debug log does not seem to give me any more detailed information. •
    JdkClassWriter.class
    is only present in dependencies that are also present in other projects that do not have this problem..
    v
    v
    • 3
    • 10
  • 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?
    v
    • 2
    • 3