I was working on an Android Studio application when I ran into this error.
Process: com.example.visualizercopy, PID: 28098
java.lang.RuntimeException
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.
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
I figured it out, I had to update the android.support.constraint.ConstraintLayout
tags to androidx.constraintlayout.widget.ConstraintLayout
in my layout XML.