Migration to androidX - can't import/find androidx.databinding.DatabindingUtil
The problem was that I tried to do it manually. So I upgraded to Android Studio 3.2 RC 2. After that I used the migrate function of Android Studio.
For the migrate function in Android Studio go to > Refactor > Migrate to AndroidX...
When Android Studio gives you errors after that, try to Rebuild or maybe use > File > Invalidate Cache & Restart.
As @cchcc pointed out, don't forget to add this to your gradle.properties
:
android.useAndroidX=true
android.enableJetifier=true
I was missing the
android {
dataBinding {
enabled = true
}
}
Be sure you are using Android Studio 3.2 RC 2
Add 2 lines below in
gradle.properties
fileandroid.useAndroidX=true
android.enableJetifier=true