Search code examples
androidandroidxandroid-jetifier

AndroidX migrate dependency / libraries


I have successfully migrated my project to AndroidX. App is running perfectly, but I am getting compile time errors, because my dependencies use support package.

image1

image2

Reason of this error

Because PhotoView is a dependency class, which uses android.support.v7.widget.AppCompatImageView which is no more available in my project. Because it is now androidx.appcompat.widget.AppCompatImageView

Project still run?

Yes, android.enableJetifier convert this dependency to AndroidX at runtime, but I want to get rid of compile time errors.

Is there a quick fix for now?


Solution

  • I solved this issue by deleting .idea folder and syncing project again.

    This seems a bug of IDE not Jetifier, it does not re-sync dependencies after migrating. Jetifier does its work well. It converts all dependencies support libraries into androidx at building time. See @this post for good explaination.