apache/iceberg · error · GradleException
Found unsupported Scala version:
Error message
Found unsupported Scala version:
What it means
settings.gradle validates the Scala version (from -DscalaVersion or defaultScalaVersion) against knownScalaVersions. Since the build supports only specific Scala minor versions per Spark release, an unknown value throws this GradleException naming the unsupported Scala version.
Solutions
- Use one of the known Scala versions, typically -DscalaVersion=2.12 or 2.13 (check knownScalaVersions in gradle.properties).
- Omit -DscalaVersion to use defaultScalaVersion.
- Ensure the Scala version is compatible with the requested Spark versions (e.g. Spark 3.x with 2.12/2.13).
- Fix typos in the property value.
Example fix
// before ./gradlew build -DscalaVersion=2.11 // after ./gradlew build -DscalaVersion=2.13
Defensive patterns
Strategy: validation
Validate before calling
KNOWN=$(grep knownScalaVersions gradle.properties | cut -d= -f2); [[ ",$KNOWN," == *",$SCALA_VERSION,"* ]] || echo "Unsupported Scala: $SCALA_VERSION"
Prevention
- Use -DscalaVersion=2.12 or 2.13 only (current known set).
- Match the Scala version to the requested Spark version.
- Omit the property to use defaultScalaVersion.
When it happens
Trigger: Running Gradle with -DscalaVersion=2.11 (or another value not in knownScalaVersions, e.g. only 2.12 and 2.13 are known); setting scalaVersion in gradle.properties to a typo or unsupported minor.
Common situations: Attempting a Scala 2.11 build on a modern Iceberg; typo like '2.14'; copying flags from an older branch where different Scala versions were supported.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Found unsupported Flink versions:
- Found unsupported Kafka versions:
- Found unsupported Spark versions:
- Cannot assume role to sign REST requests because is not…
- Cannot clean files incrementally when snapshot IDs are…
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/e9badd2d6f6e8751.
Report an issue: GitHub.
Appendix: source
Thrown at settings.gradle:107
List<String> sparkVersions = sparkVersionsString != null && !sparkVersionsString.isEmpty() ? sparkVersionsString.split(",") : []
if (!knownSparkVersions.containsAll(sparkVersions)) {
throw new GradleException("Found unsupported Spark versions: " + (sparkVersions - knownSparkVersions))
}
List<String> knownKafkaVersions = System.getProperty("knownKafkaVersions").split(",")
String kafkaVersionsString = System.getProperty("kafkaVersions") != null ? System.getProperty("kafkaVersions") : System.getProperty("defaultKafkaVersions")
List<String> kafkaVersions = kafkaVersionsString != null && !kafkaVersionsString.isEmpty() ? kafkaVersionsString.split(",") : []
if (!knownKafkaVersions.containsAll(kafkaVersions)) {
throw new GradleException("Found unsupported Kafka versions: " + (kafkaVersions - knownKafkaVersions))
}
List<String> knownScalaVersions = System.getProperty("knownScalaVersions").split(",")
String scalaVersion = System.getProperty("scalaVersion") != null ? System.getProperty("scalaVersion") : System.getProperty("defaultScalaVersion")
if (!knownScalaVersions.contains(scalaVersion)) {
throw new GradleException("Found unsupported Scala version: " + scalaVersion)
}
if (!flinkVersions.isEmpty()) {
include 'flink'
project(':flink').name = 'iceberg-flink'
}
if (flinkVersions.contains("1.20")) {
include ":iceberg-flink:flink-1.20"
include ":iceberg-flink:flink-runtime-1.20"
project(":iceberg-flink:flink-1.20").projectDir = file('flink/v1.20/flink')
project(":iceberg-flink:flink-1.20").name = "iceberg-flink-1.20"
project(":iceberg-flink:flink-runtime-1.20").projectDir = file('flink/v1.20/flink-runtime')
project(":iceberg-flink:flink-runtime-1.20").name = "iceberg-flink-runtime-1.20"
}
if (flinkVersions.contains("2.1")) {
include ":iceberg-flink:flink-2.1"View on GitHub (pinned to 86d9c8fc54)