androidx.constraintlayout.widget.constraintlayout don't have chains that you can drag

41,527

Solution 1

I had the same problem until I realized that I should use the Canary version to solve it. after installing Canary version beside stable version, open the project and now you can use this implementation:

implementation 'androidx.constraintlayout:constraintlayout:1.1.2'

instead of

implementation 'com.android.support.constraint:constraint-layout:1.1.2'

Keep in mind that you may need to do the following:

  • clean project
  • rebuild
  • invalidate caches/restart

My problem solved with this method.

Solution 2

if you are using latest Android update 3.3.3 then migrate to Android x from support constraint layout:

<android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

For getting this also change gradle:

implementation com.android.support.constraint:constraint-layout:1.1.3

to

implementation androidx.constraintlayout:constraintlayout:2.0.0-alpha3

Share:
41,527

Related videos on Youtube

raquezha
Author by

raquezha

raquezha. what else? Kotlin is &lt;3

Updated on July 09, 2022

Comments

  • raquezha
    raquezha almost 2 years

    I'm using androidx.constraintlayout.widget.ConstraintLayout in my layout and it does not show the chains, also I can't drag any widgets. I just type the constraints that I want to use.

    <androidx.constraintlayout.widget.ConstraintLayout
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="112dp"/>
    

    here's a sample screen shot for androidx constraintLayout: androidx.constraintlayout.widget.ConstraintLayout

    but when I tried switching back to : android.support.constraint.ConstraintLayout it i can see it

    <android.support.constraint.ConstraintLayout
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="112dp"/>
    

    here's a sample screen shot for support constraintLayout: android.support.constraint.ConstraintLayout

    is this a bug or something?

    edit:

    my current solution is to switch from:

    implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
    

    to

    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    

    but this does not solve my problem cause I don't want to use support.

  • raquezha
    raquezha over 5 years
    I'm using canary version when I've encountered this. I've realized that maybe because it's in the 'CANARY' version where we encounter more bugs, and where bugs can autofix itself. I updated my Android Studio to 3.3 Canary 6 and now its working
  • bickster
    bickster over 4 years
    Clean project is all I had to do