Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

buildFeatures is unstable because its signature references unstable ... marked with @Incubating

Updating Android studio project and migrating to Kotlin dsl. I see the above warning wrapping the buildFeatures block where i enable dataBinding and more recent viewbinding features, my AS and gradle, kotlin plugin versions are as below:

Android studio V4.0

// defined in buildSrc\build.gradle.kts

val kotlinVersion     = "1.3.71"
val gradleVersion     = "4.0.0"

everything is workging fine except, for a warning on this block in my (app) build.gradle.kts on all 3 lines:

 buildFeatures{
     dataBinding = true
     viewBinding = true
 }

the warning messages that appear when hovering over each line are as follows:

'buildFeatures(kotlin.jvm.functions.Function1<? super com.android.build.api.dsl.ApplicationBuildFeatures,kotlin.Unit>)'
is unstable because its signature references unstable 'com.android.build.api.dsl.ApplicationBuildFeatures' 
marked with @Incubating 
'getDataBinding()' is declared in unstable 'com.android.build.api.dsl.BuildFeatures' marked with @Incubating 
'getViewBinding()' is declared in unstable 'com.android.build.api.dsl.BuildFeatures' marked with @Incubating 

Any clue on why are they marked as warnings, the same block was in the original build.gradle file before converting to .kts

like image 455
Jamal S Avatar asked Aug 31 '25 10:08

Jamal S


1 Answers

Don't worry, it's just a friendly warning, that you are using @Incubating class. Let's look into definition:

Indicates that a feature is incubating. This means that the feature is currently a work-in-progress and may change at any time.

So don't worry, and use it, and eventually update it in the future. Probably, it will be marked as stabled in some future Android Studio and plugin versions.

----- EDIT -----

If you would like to remove this warning then put @Suppress("UnstableApiUsage") above your line

like image 103
Krystian Kaniowski Avatar answered Sep 02 '25 22:09

Krystian Kaniowski