I had the same problem, I resolved it as follows:
In your dependecies if you have added
implementation 'androidx.constraintlayout:constraintlayout:1.x.x'
that is correct
but in your xml layout file you have to use the widget as
androidx.constraintlayout.widget.ConstraintLayout