Error inflating class android.support.constraint.ConstraintLayout

前端 未结 3 533
余生分开走
余生分开走 2020-12-02 03:15

I was working on an Android Studio application when I ran into this error.

    Process: com.example.visualizercopy, PID: 28098
    java.lang.RuntimeException         


        
相关标签:
3条回答
  • 2020-12-02 03:30

    You are using androidX packages. So you have to migrate all android.support library with androidX.

    So replace below line in gradle,

    implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
    

    With this,

    implementation 'androidx.constraintlayout:constraintlayout:1.1.2' 
    

    Reference here.

    0 讨论(0)
  • 2020-12-02 03:34

    If you are using androidX packages or you want to use them for your project, then you have to migrate your project to androidX. For that you need to follow below steps:

    1) In Android Studio, just goto Refactor-> Migrate to AndroidX to migrate your project and there you can backup your project if some problem occurs migrating project.

    After that your dependendencies will have androidX packages automatically.

    Further reading: Here

    0 讨论(0)
  • 2020-12-02 03:54

    I figured it out, I had to update the android.support.constraint.ConstraintLayout tags to androidx.constraintlayout.widget.ConstraintLayout in my layout XML.

    0 讨论(0)
提交回复
热议问题