This page summarizes the different task (or in general work) validation problems that Gradle reports and provides guidance for fixing them.

Invalid use of @CacheableTransform

This error indicates that you have annotated a type with @CacheableTransform but this annotation only makes sense on artifact transforms types. Therefore, it’s a no-op.

The solution is to remove the annotation. For tasks, the annotation to use is @CacheableTask.

Missing normalization annotation

This error occurs whenever a task or artifact transform is cacheable and that a file or file collection input property isn’t declaring how it should be normalized. Normalization tells Gradle if, for example, the absolute path of input files matter or if only the contents is relevant. If you don’t declare the normalization strategy, outputs of the task cannot be reused between machines or between different locations on the same machine. In short, without normalization, caching is highly ineffective.

To fix this problem, you need to declare a normalization strategy, by applying one of the following annotations:

Required value isn’t set

This error indicates that a property expected a value but none was provided. By default, Gradle properties are required, that is to say that if an input or output property isn’t configured, either via a conventional value or explicitly by a build script, then Gradle will fail because it doesn’t know what value to use when the task is executed.

To fix the problem, you must either:

  • provide a value for this property explicitly (for example by configuring the task in your build script)

  • or make the property optional by annotating it with @Optional

Invalid use of absolute path sensitivity for an artifact transform

This error indicates that you have annotated an input of a cacheable artifact transform as sensitive to the absolute path. However, artifact transforms are executed in isolation using their own workspace which, for example, is resilient to clean builds. Even if the artifact transform result can’t be shared via the build cache, using an absolute path sensitivity doesn’t make sense.

To fix this problem, you must change the normalization strategy using one of those:

Invalid use of an output property on an artifact transforms

This error indicates that you have annotated a property of an artifact transform with an output annotation, which is not the correct way to register outputs for artifact transforms.

To fix this problem, you must remove the property and use the TransformOutputs parameter instead.