Luke Needham
Luke Needham

Reputation: 4019

Didn't find class "android.support.constraint.Barrier"

I'm trying to use the Barrier view in ConstraintLayout:

<android.support.constraint.Barrier
    android:id="@+id/buttonBarrier"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:barrierDirection="top"
    app:constraint_referenced_ids="answer1Button,answer2Button"
    />

It works fine in the IDE, and I get Barrier-specific lint messages. But when I run the app, it crashes trying to inflate the layout containing the Barrier:

java.lang.ClassNotFoundException: Didn't find class "android.support.constraint.Barrier"

I am using AndroidX ConstraintLayout 1.1.3:

implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

What's happening here?

Upvotes: 6

Views: 821

Answers (1)

hrach
hrach

Reputation: 2492

The xml tag is androidx.constraintlayout.widget.Barrier in the latest AndroidX version.

Upvotes: 9

Related Questions