{"record":{"id":"371ea3c1d97c0af8","repo":"gradle/gradle","slug":"cannot-convert-path-s-to-a-relative-path","errorCode":null,"errorMessage":"Cannot convert path %s to a relative path.","messagePattern":"Cannot convert path (.+?) to a relative path\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"platforms/core-configuration/file-collections/src/main/java/org/gradle/api/internal/file/IdentityFileResolver.java","lineNumber":37,"sourceCode":"\n/**\n * FileResolver that uses the file provided to it or constructs one from the toString of the provided object. Used in cases where a FileResolver is needed by the infrastructure, but no base directory\n * can be known.\n *\n * NOTE: Do not create instances of this type. Instead, use the {@link FileLookup} service.\n */\npublic class IdentityFileResolver extends AbstractFileResolver {\n    @Override\n    protected File doResolve(File path) {\n        if (!path.isAbsolute()) {\n            throw new UnsupportedOperationException(String.format(\"Cannot convert relative path %s to an absolute file.\", path));\n        }\n        return path;\n    }\n\n    @Override\n    public String resolveAsRelativePath(Object path) {\n        throw new UnsupportedOperationException(String.format(\"Cannot convert path %s to a relative path.\", path));\n    }\n\n    @Override\n    public boolean canResolveRelativePath() {\n        return false;\n    }\n}\n","sourceCodeStart":19,"sourceCodeEnd":45,"githubUrl":"https://github.com/gradle/gradle/blob/534f27719b66953f95cc907aae7f2c1b12f5482d/platforms/core-configuration/file-collections/src/main/java/org/gradle/api/internal/file/IdentityFileResolver.java#L19-L45","documentation":"Gradle throws this error when the following condition is violated: Cannot convert path <value> to a relative path.","triggerScenarios":"Thrown at platforms/core-configuration/file-collections/src/main/java/org/gradle/api/internal/file/IdentityFileResolver.java:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a value whose type matches the property type.","Convert the value explicitly (e.g. via map()) before assigning it to the property."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"534f27719b66953f95cc907aae7f2c1b12f5482d","analyzedAt":"2026-08-22T08:09:12.375Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}