Reputation: 3556
I migrated my project to androidx and now I'm receiving errors for every databinding generated class because all these generated classes still use import android.support.v7
instead of android x. So far I tried to delete all generated classes and rebuild project, but it generates same ones after building project. Does anyone know how to solve it?
Upvotes: 0
Views: 285
Reputation: 2764
Even though you have migrated to AndroidX, as you said your classes are still using the old imports. Android Studio doesn't seem to refactor it well enough for some reason. This happened to me too and I had to manually delete the invalid imports and add the androidx
imports. (alt + enter) to add the correct imports after deleting the invalid imports.
Edit: you'll need to change the class imports as well as the full qualified names of the widgets in the xml layout, menu, etc. files.
Change import android.support.v4.app.Fragment;
To
import androidx.fragment.app.Fragment;
Change <android.support.design.widget.CoordinatorLayout>
To <androidx.constraintlayout.widget.ConstraintLayout>
Upvotes: 1