Assuming that you are familiar with AndroidX
. If not, please see @this post.
Jetifier
will convertsupport libraries
of all your dependencies
toAndroidX
automatically, if you don’t set it totrue
then your
project will have both, the support (got deprecated after 28.0.0
version) and AndroidX package, which is redundant.
For Example
If you have PhotoView.java
in your dependency. That uses support library AppCompatImageView
.
import android.support.v7.widget.AppCompatImageView;
This class is moved now to androidx
package, so how will PhotoView
get androidx AppCompatImageView
? And app still runs in device.
Who made this run ?
Jetifier, which converts all support package of dependency at build time.
Jetifier will convert android.support.v7.widget.AppCompatImageView
to androidx.appcompat.widget.AppCompatImageView
while building the project.
Conclusion
Enabling Jetifier is important when you migrate from Support Libraries to AndroidX.
See this post to understand more about AndroidX.
Info
Your code may show compile time errors after enabling Jetifier while using dependency classes.
which you can remove by deleting .idea
, .gradle
and re-sync project.