{"record":{"id":"0cbdd94c61334ac8","repo":"gradle/gradle","slug":"unexpected-convention-supporting-type-s-used-in-p","errorCode":null,"errorMessage":"Unexpected convention-supporting type %s used in property %s.%s","messagePattern":"Unexpected convention-supporting type (.+?) used in property (.+?)\\.(.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"platforms/core-configuration/model-core/src/main/java/org/gradle/internal/extensibility/ConventionAwareHelper.java","lineNumber":94,"sourceCode":"        String renamedProperty = ProviderApiMigrationConventionHelper.findRenamedProperty(sourceType, propertyName);\n        if (renamedProperty != null) {\n            propertyName = renamedProperty;\n        }\n\n        if (_ineligiblePropertyNames.contains(propertyName)) {\n            Method getter = JavaPropertyReflectionUtil.findGetterMethod(sourceType, propertyName);\n            // When there's a convention-supporting object, use its `.convention()` method instead\n            // This is something we added to support properties migrated in the future from\n            // Java bean to Property where old code uses ConventionMapping to set conventions.\n            if (getter != null && SupportsConvention.class.isAssignableFrom(getter.getReturnType())) {\n                SupportsConvention target;\n                try {\n                    target = Cast.uncheckedNonnullCast(getter.invoke(_source));\n                } catch (IllegalAccessException | InvocationTargetException e) {\n                    throw new IllegalStateException(String.format(\"Could not access property %s.%s\", sourceType.getSimpleName(), propertyName), e);\n                }\n                if (!mapConventionOn(target, mapping)) {\n                    throw new IllegalStateException(String.format(\n                        \"Unexpected convention-supporting type %s used in property %s.%s\", getter.getReturnType().getName(), sourceType.getSimpleName(), propertyName));\n                }\n            } else {\n                throw DocumentedFailure.builder()\n                    .withSummary(\"Using internal convention mapping with a Provider backed property.\")\n                    .withUpgradeGuideSection(7, \"convention_mapping\")\n                    .build();\n            }\n        } else {\n            _mappings.put(propertyName, mapping);\n        }\n        return mapping;\n    }\n\n    private boolean mapConventionOn(SupportsConvention target, MappedPropertyImpl mapping) {\n        if (target instanceof FileSystemLocationProperty) {\n            FileSystemLocationPropertyInternal<?> asFileSystemLocationProperty = Cast.uncheckedNonnullCast(target);\n            asFileSystemLocationProperty.conventionFromAnyFile(new DefaultProvider<>(() -> mapping.getValue()));","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/gradle/gradle/blob/534f27719b66953f95cc907aae7f2c1b12f5482d/platforms/core-configuration/model-core/src/main/java/org/gradle/internal/extensibility/ConventionAwareHelper.java#L76-L112","documentation":"Gradle throws this error when the following condition is violated: Unexpected convention-supporting type <value> used in property <value>.<value>","triggerScenarios":"Thrown at platforms/core-configuration/model-core/src/main/java/org/gradle/internal/extensibility/ConventionAwareHelper.java:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Review the values passed to this API and correct the invalid input described in the error message."],"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"}