jetifier

    Note: Before you begin the migration, you should update your library to useversion 28.0.0 of the support library.

    To install Jetifier, and extract it. Your device must have Java version 1.8 installed.

    To process a library, pass the path to the current library and the path to theoutput file that the tool should create. Jetifier supports JAR, AAR, and ZIPfiles, including nested archives.

    Example

    Jetifier migrates Java, XML, POM and ProGuard references that point toandroid.support. packages, changing them so they point to the correspondingandroidx. packages.

    Since ProGuard wildcards for do not always map directly toandroidx. packages, Jetifier produces all eligible substitutions.

    If there is a type in an android.support.* package that does not come from anysupport library artifact, Jetifier still migrates the type as long as there is amapping for it. However, this migration is not guaranteed to work, as theremight not be mapping rules general enough to cover all the custom types.

    If you pass the -r flag, the utility runs in reverse mode. In this mode, theutility converts AndroidX APIs to the support library equivalents, instead ofthe other way around. Reverse mode is useful, for example, if you are developinglibraries that use AndroidX APIs, but also need to distribute versions that usethe support library.

    Example

    The following example runs the utility in reverse mode on the library (in the current directory) and writes the output tosupportLibVersion.aar in the same directory:

    The Jetifier tool uses a config file to map support library classes to theirAndroidX equivalents. If necessary, you can make a custom config file thatalters this mapping. You can even add new classes to the mapping that are notactually members of the support library; for example, you might modify themapping to replace one of your own classes with a successor class written to useAndroidX.