gradle/gradle · error · RuntimeException

No value with key '%s' specified in wrapper properties file

Error message

No value with key '%s' specified in wrapper properties file '%s'.

What it means

WrapperExecutor.getProperty(..., required=true) terminates in reportMissingProperty, which throws naming the exact key and file. In practice distributionUrl is the only required wrapper property (all others have defaults); the wrapper cannot proceed without knowing which distribution to install.

Source

Thrown at platforms/core-runtime/wrapper-shared/src/main/java/org/gradle/wrapper/WrapperExecutor.java:151

    // Returns null only in the !required branch; callers passing required=true rely on a non-null result.
    @SuppressWarnings("NullAway")
    private String getProperty(String propertyName, @Nullable String defaultValue, boolean required) {
        String value = properties.getProperty(propertyName);
        if (value != null) {
            return value;
        }
        if (defaultValue != null) {
            return defaultValue;
        }
        if (required) {
            return reportMissingProperty(propertyName);
        } else {
            return null;
        }
    }

    private String reportMissingProperty(String propertyName) {
        throw new RuntimeException(String.format(
                "No value with key '%s' specified in wrapper properties file '%s'.", propertyName, propertiesFile));
    }
}

View on GitHub (pinned to 534f27719b)

Solutions

  1. Add the key exactly as 'distributionUrl' with a full URL: distributionUrl=https://services.gradle.org/distributions/gradle-<version>-bin.zip
  2. Uncomment the line and verify exact casing and no leading spaces or BOM bytes
  3. Regenerate the wrapper ('gradle wrapper --gradle-version <v>') to obtain a canonical file

Example fix

# before — key commented out
#distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip

# after
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
Defensive patterns

Strategy: validation

Validate before calling

# assert the one required key before building
if ! grep -qE '^distributionUrl=' gradle/wrapper/gradle-wrapper.properties; then
  echo "gradle-wrapper.properties is missing distributionUrl"; exit 1
fi

Prevention

When it happens

Trigger: gradle/wrapper/gradle-wrapper.properties exists but lacks a readable distributionUrl key (misspelled, commented out, wrong case, or BOM-prefixed so java.util.Properties does not match it); any ./gradlew launch then fails during wrapper configuration.

Common situations: Manually created or templated wrapper files; keys renamed during Gradle upgrades; properties files saved with exotic encodings; empty properties files committed by accident.

Related errors


AI-assisted analysis of gradle/gradle@534f27719b (2026-08-22). Data as JSON: /api/errors/92ee95878ac6ab35. Report an issue: GitHub.