Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 918
Luke Avatar asked Feb 08 '19 15:02

Luke


1 Answers

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

like image 145
hrach Avatar answered Nov 15 '22 01:11

hrach