{"record":{"id":"94d6478da6bf36e2","repo":"gradle/gradle","slug":"you-can-t-map-a-property-that-does-not-exist-prop","errorCode":null,"errorMessage":"You can't map a property that does not exist: propertyName={propertyName}","messagePattern":"You can't map a property that does not exist: propertyName=(.+?)","errorType":"exception","errorClass":"InvalidUserDataException","httpStatus":null,"severity":"error","filePath":"platforms/core-configuration/model-core/src/main/java/org/gradle/internal/extensibility/ConventionAwareHelper.java","lineNumber":67,"sourceCode":"public class ConventionAwareHelper implements ConventionMapping {\n    //prefix internal fields with _ so that they don't get into the way of propertyMissing()\n    private final IConventionAware _source;\n    // These are properties that could have convention mapping applied to them\n    private final Set<String> _propertyNames;\n    // These are properties that should not be allowed to use convention mapping\n    private final Set<String> _ineligiblePropertyNames;\n\n    private final Map<String, MappedPropertyImpl> _mappings = new HashMap<>();\n\n    public ConventionAwareHelper(IConventionAware source) {\n        this._source = source;\n        this._propertyNames = JavaPropertyReflectionUtil.propertyNames(source);\n        this._ineligiblePropertyNames = new HashSet<>();\n    }\n\n    private MappedProperty map(String propertyName, MappedPropertyImpl mapping) {\n        if (!_propertyNames.contains(propertyName)) {\n            throw new InvalidUserDataException(\n                \"You can't map a property that does not exist: propertyName=\" + propertyName);\n        }\n\n        Class<? extends IConventionAware> sourceType = _source.getClass();\n\n        // Route ConventionMapping(\"oldName\") to the renamed lazy property's `.convention()` API\n        // (e.g. CreateStartScripts: getOutputDir File -> getOutputDirectory DirectoryProperty).\n        // The eager getter is kept as a backward-compat bridge but external plugins still register conventions with the old name.\n        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.","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/gradle/gradle/blob/534f27719b66953f95cc907aae7f2c1b12f5482d/platforms/core-configuration/model-core/src/main/java/org/gradle/internal/extensibility/ConventionAwareHelper.java#L49-L85","documentation":"Gradle throws this error when the following condition is violated: You can't map a property that does not exist: propertyName=<propertyName>","triggerScenarios":"Thrown at platforms/core-configuration/model-core/src/main/java/org/gradle/internal/extensibility/ConventionAwareHelper.java:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the path is correct and that the file or directory actually exists before referencing it.","Create the missing file/directory or update the build script to point at an existing location."],"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"}