Gradle 8.12 Release Notes
Description: Enhanced error and warning reporting, file-system watching on Alpine Linux, and Swift 6 support.

# Gradle Release Notes

The Gradle team is excited to announce Gradle 8.12.

This release improves error and warning reporting by summarizing duplicate entries in the Problems API's generated problems report for better readability. The console output is also enhanced when the Problems API is used to fail the build.

Gradle 8.12 introduces platform enhancements, including file-system watching support on the Alpine Linux distribution and support for building and testing Swift 6 applications.

Additionally, artifact transform ambiguities now produce a deprecation warning with clearer, more actionable information and new methods are available in the DependencyConstraint API.

We would like to thank the following community members for their contributions to this release of Gradle: Abhiraj Adhikary, Ayush Saxena, Björn Kautler, davidburstrom, Dominic Fellbaum, Emmanuel Ferdman, Finn Petersen, Johnny Lim, Mahdi Hosseinzadeh, Martin Bonnin, Paint_Ninja, Petter Måhlén, Philip Wedemann, stegeto22, Tanish, TheGoesen, Tim Nielens, Trout Zhang, Victor Merkulov

Be sure to check out the public roadmap for insight into what's planned for future releases.

## Table Of Contents

## Upgrade instructions

Switch your build to use Gradle 8.12 by updating the Wrapper in your project:

`./gradlew wrapper --gradle-version=8.12`

See the Gradle 8.x upgrade guide to learn about deprecations, breaking changes, and other considerations when upgrading to Gradle 8.12.

For Java, Groovy, Kotlin, and Android compatibility, see the full compatibility notes.

## New features and usability improvements

### Error and warning reporting improvements

Gradle provides a rich set of error and warning messages to help you understand and resolve problems in your build.

#### Summarization in the HTML report for problems

The Problems API provides structured feedback on build issues, helping developers and tools like IDEs identify and resolve warnings, errors, or deprecations during configuration or runtime.

This release introduces a new problem summarization mechanism that reduces redundancy in the generated HTML Problems Report.

The feature limits the number of identical problems reported and provides a summarized count of additional occurrences in the summary report:

#### Ambiguous Artifact Transformation chains are detected and reported

Previously, when two or more equal-length chains of artifact transforms produced compatible variants to satisfy a resolution request, Gradle would arbitrarily and silently select one. Gradle now emits a warning for this case.

This deprecation warning is the same failure message that now appears when multiple equal-length chains are available, producing incompatible variants that could each satisfy a resolution request. In this case, resolution fails with an ambiguity failure, and Gradle emits a message like this:

    FAILURE: Build failed with an exception.

    * What went wrong:
    Could not determine the dependencies of task ':forceResolution'.
    > Could not resolve all dependencies for configuration ':resolveMe'.
       > Found multiple transformation chains that produce a variant of 'root project :' with requested attributes:
           - color 'red'
           - matter 'liquid'
           - shape 'round'
         Found the following transformation chains:
           - From configuration ':squareBlueLiquidElements':
               - With source attributes:
                   - artifactType 'txt'
                   - color 'blue'
                   - matter 'liquid'
                   - shape 'square'
                   - texture 'smooth'
               - Candidate transformation chains:
                   - Transformation chain: 'ColorTransform' -> 'ShapeTransform':
                       - 'BrokenColorTransform':
                           - Converts from attributes:
                               - color 'blue'
                               - texture 'smooth'
                           - To attributes:
                               - color 'red'
                               - texture 'bumpy'
                       - 'BrokenShapeTransform':
                           - Converts from attributes:
                               - shape 'square'
                               - texture 'bumpy'
                           - To attributes:
                               - shape 'round'
                   - Transformation chain: 'ColorTransform' -> 'ShapeTransform':
                       - 'BrokenColorTransform':
                           - Converts from attributes:
                               - color 'blue'
                               - texture 'smooth'
                           - To attributes:
                               - color 'red'
                               - texture 'rough'
                       - 'BrokenShapeTransform':
                           - Converts from attributes:
                               - shape 'square'
                               - texture 'rough'
                           - To attributes:
                               - shape 'round'

The formatting of this message has been improved to comprehensively display information about each complete chain of transformations that produces the candidates that would satisfy the request. This allows authors to better analyze and understand their builds, allowing them to remove ambiguity.

### Platform enhancements

Gradle provides many features for specific platforms and languages.

#### File-system watching and continuous mode support on Alpine Linux

File-system watching is now supported on Alpine Linux, a popular choice for container-based images and the default distribution for Docker.

The feature is enabled by default, as is the case with all other supported platforms.

Additionally, it is now possible to run builds in continuous mode on Alpine Linux.

#### Swift 6 support

Gradle’s Swift support allows you to build and test native Swift libraries and applications.

Gradle now supports Swift 6, introduced with Xcode 16.0, extending its capabilities to the latest major version of Swift.

### Build authoring improvements

Gradle provides rich APIs for plugin authors and build engineers to develop custom build logic.

#### Richer console output for failures using the Problems API

The Problems API provides structured feedback on build issues, helping developers and tools like IDEs identify and resolve warnings, errors, or deprecations during configuration or runtime.

With this release, problems that are the source of a build failure have all of their information displayed on the console output at the end of the build:

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':sample-project:myFailingTask'.
    > Message from runtime exception
        This happened because ProblemReporter.throwing() was called
          This is a demonstration of how to add
          detailed information to a build failure

    * Try:
    > Remove the Problems.throwing() method call from the task action
    > Run with --scan to get full insights.

    BUILD FAILED in 10s

This example output was obtained by using the Problems API as shown below:

    public abstract class FailingTask extends DefaultTask {

        @Inject public abstract Problems getProblems();

        @TaskAction public void run() {
            throw getProblems().getReporter().throwing(problemSpec -> {
                problemSpec.contextualLabel("This happened because ProblemReporter.throwing() was called");
                problemSpec.details("This is a demonstration of how to add\ndetailed information to a build failure");
                problemSpec.withException(new RuntimeException("Message from runtime exception"));
                problemSpec.solution("Remove the Problems.throwing() method call from the task action");
            });
        }
    }

Check out our sample project for the complete code.

This will enable plugin authors to fully leverage the Problems API to enhance any error with additional details, documentation links, and possible resolution steps.

See the Problems API for more information.

#### `DependencyConstraintHandler` now has `addProvider` methods

The `DependencyConstraintHandler` now has `addProvider` methods, similar to the `DependencyHandler`.

These are useful in plugin code to bring attention to where inputs should and should not be lazily evaluated by preventing eager results from being passed in.

## Promoted features

Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backward compatibility. See the User Manual section on the “Feature Lifecycle” for more information.

The following are the features that have been promoted in this Gradle release.

### Service reference properties are now stable

Service references are task properties meant to facilitate the consumption of shared build services.

`ServiceReference` is now stable.

## Fixed issues

## Known issues

Known issues are problems that were discovered post-release that are directly related to changes made in this release.

## External contributions

We love getting contributions from the Gradle community. For information on contributing, please see gradle.org/contribute.

## Reporting problems

If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines. If you're not sure if you're encountering a bug, please use the forum.

We hope you will build happiness with Gradle, and we look forward to your feedback via Twitter or on GitHub.