LinuxCommandLibrary

jetifier

Migrate support libraries to AndroidX

TLDR

Migrate project dependencies to the AndroidX format

$ jetifier
copy

Migrate project dependencies from the AndroidX format
$ jetifier reverse
copy

SYNOPSIS

jetifier-standalone [options]

PARAMETERS

--input <path>
    Input file or directory to process (required)

--output <path>
    Output file or directory for jetified results (required)

--overwrite
    Overwrite existing output files without prompting

--verbose
    Enable verbose logging

--debug
    Enable debug-level logging

--print-inputs
    List all inputs that will be processed

--print-used-maps
    Show mappings applied during processing

--ignore-missing-tags
    Continue if @Keep annotations are missing

--keep-tmp-dex
    Retain temporary DEX files for debugging

DESCRIPTION

Jetifier is a standalone utility from the Android development ecosystem designed to automatically rewrite binaries dependent on the deprecated Android Support Libraries to use the modern AndroidX equivalents.

It processes JAR, AAR, or class files, replacing references in bytecode such as android.support.v4 with androidx.core. This is crucial for migrating legacy Android projects to AndroidX without manual refactoring of third-party dependencies.

Originally integrated into Android Studio's refactoring tool, the standalone version allows batch processing of libraries outside an IDE or Gradle build. Run via Java, it scans inputs for mappings defined in a compatibility matrix and applies transformations. Useful for library maintainers or developers handling unmaintained deps.

Supports recursive directory processing, verbose logging, and safeguards like backups. While powerful, it's not for source code—use Android Studio's migrator for that. Essential for Android devs targeting API 28+.

CAVEATS

Requires Java runtime; processes bytecode only, not source code.
Not idempotent—repeated runs may cause issues without --overwrite.
Limited to known mappings; unmapped artifacts pass unchanged.

INVOCATION

Run as java -jar jetifier-standalone.jar --input lib/ --output lib-jetified/
Download JAR from Android developer site.

EXAMPLE

jetifier-standalone --input mylib.aar --output mylib-jetified.aar --verbose

HISTORY

Introduced by Google in 2018 with AndroidX launch as part of SDK tools.
Standalone JAR released for non-Gradle use; evolved with mapping updates via Android Gradle Plugin.

SEE ALSO

java(1), jar(1), gradle(1)

Copied to clipboard