Search code examples
kotlingradlegradle-kotlin-dsl

Gradle "There is no feature named VERSION_CATALOGS"


I am trying to upgrade Gradle version from 7.x to 8.x. However, when I completed my Gradle wrapper upgrade and ran the project I encountered the following error:

Settings file '.../settings.gradle.kts' line: 7

There is no feature named VERSION_CATALOGS

Here is how my settings.gradle.kts looks like:

include(
    ":project-a",  
    ":project-b",  
)

dependencyResolutionManagement {
    enableFeaturePreview("VERSION_CATALOGS")  
    versionCatalogs {  
        create("libs") {  
            val kotlinVersion = "1.8.10"  
            val dokkaVersion = "1.8.10"
            
            plugin("jetbrains-kotlin-jvm", "org.jetbrains.kotlin.jvm").version(kotlinVersion)  
            plugin("jetbrains-dokka", "org.jetbrains.dokka").version(dokkaVersion)  
        }  
    }
}

When I checked the release notes, there was no mention of this, has it been fully de-incubated?


Solution

  • The versionCatalogs block was promoted to a stable feature since 7.4 RC1. However, the inactive feature preview was removed in v8.0.0-M1. (I assume a lot of users who have forgotten to remove it early will encounter this error on upgrade)

    So you can safely ignore this error, and remove line number 7. (i.e. enableFeaturePreview("VERSION_CATALOGS"))

    Other helpful resources: