MissingConstraints lint error when using Flow

Viewed 622

I'm using the recently released constraint layout version 2.0 and they have added a new feature called Flow which basically replaces what linear layout used to do ( with more customization ). But the android lint is blocking my CI from building because it thinks the views are missing constraint. Suppressing this lint error for each of these views seems a plan B so am asking if there is a way to update lint independently from other components of the Gradle.

Currently running:

  • Gradle = 6.1.1
  • AndroidGradlePlugin = 4.0.1
  • Kotlin = 1.4
2 Answers

Make sure that you don't have spaces between ids values in app:constraint_referenced_ids attribute so if you have e.g. this:

app:constraint_referenced_ids="view_1, view_2, view_3"

you should rewrite it to:

app:constraint_referenced_ids="view_1,view_2,view_3"

also you can suppress such warning for a particular view by setting tools:ignore="MissingConstraints" to it or for all the views by setting that attribute for the parent ConstraintLayout but it isn't recommend.

Related