[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Jetifier\n\nThe standalone Jetifier tool migrates support-library-dependent libraries to\ninstead rely on the equivalent AndroidX packages. The tool lets you migrate an\nindividual library directly instead of using the Android Gradle plugin bundled\nwith Android Studio.\n| **Note:** Before you begin the migration, update your library to use version 28.0.0 of the Support Library.\n\nInstall Jetifier\n----------------\n\nTo install Jetifier, [download the zip\nfile](https://dl.google.com/dl/android/studio/jetifier-zips/1.0.0-beta10/jetifier-standalone.zip)\nand extract it. Your device must have Java version 1.8 or higher installed.\n\nUsage\n-----\n\nTo process a library, pass the path to the current library and the path to the\noutput file that the tool should create. Jetifier supports JAR, AAR, and ZIP\nfiles, including nested archives. \n\n```\n./jetifier-standalone -i \u003csource-library\u003e -o \u003coutput-library\u003e\n```\n\n### Options\n\nThe following table lists the available options for the Jetifier tool commands:\n\n| Option | Required? | Description |\n|----------------------------------------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `-i`, `--input` \u003cvar translate=\"no\"\u003e<path>\u003c/var\u003e | yes | Path to input library (JAR, AAR, or ZIP). |\n| `-o`, `--output` \u003cvar translate=\"no\"\u003e<path>\u003c/var\u003e | yes | Path to the output file. If the file already exists, Jetifier overwrites it. |\n| `-c`, `--config` \u003cvar translate=\"no\"\u003e<path>\u003c/var\u003e | no | Path to optional custom config file. |\n| `-l`, `--log` \u003cvar translate=\"no\"\u003e<level>\u003c/var\u003e | no | Logging level. Allowed values are: - error - warning - info - verbose If not specified, defaults to \"warning\". |\n| `-r` | no | Operate in reverse mode (\"de-jetification\"). |\n| `-rebuildTopOfTree`, `--rebuildTopOfTree` | no | Rebuild the ZIP of Maven distribution according to the generated POM file. If set, all rewritten libraries are assumed to be part of Support Library. Not needed for jetification. |\n| `-s`, `--strict` | no | Don't fallback when rules are missing; throw errors instead. |\n| `-stripSignatures`, `--stripSignatures` | no | Don't throw an error when jetifying a signed library; strip the signature files instead. |\n| `-t`, `-timestamp` \u003cvar translate=\"no\"\u003e<arg>\u003c/var\u003e | no | Timestamps policy to use for the archived entries as their modified time. Values: keepPrevious (default) epoch or now. |\n\n#### Example\n\nThe following example runs the utility on the library `libraryToProcess.aar` in\nthe current directory and writes the output to `result.aar` in the same\ndirectory: \n\n```\n./jetifier-standalone -i libraryToProcess.aar -o result.aar\n```\n\n### Usage notes\n\nJetifier migrates Java, XML, POM, and ProGuard references that point to\n`android.support.*` packages, changing them so they point to the corresponding\n`androidx.*` packages.\n\nSince ProGuard wildcards for `android.support.*` don't always map directly to\n`androidx.*` packages, Jetifier produces all eligible substitutions.\n\nIf there is a type in an `android.support.*` package that does not come from any\nSupport Library artifact, Jetifier still migrates the type as long as there is a\nmapping for it. However, this migration is not guaranteed to work, as there\nmight not be mapping rules general enough to cover all the custom types.\n\nAdvanced usage\n--------------\n\nThe Jetifier utility supports some advanced use cases.\n\n### Reverse mode\n\nIf you pass the `-r` flag, the utility runs in *reverse mode*. In this mode, the\nutility converts AndroidX APIs to the Support Library equivalents. Reverse mode\nis useful if you are developing\nlibraries that use AndroidX APIs but also need to distribute versions that use\nthe Support Library.\n\n#### Example\n\nThe following example runs the utility in reverse mode on the library\n`myAndroidXLib.aar` in the current directory and writes the output to\n`supportLibVersion.aar` in the same directory: \n\n```\n./jetifier-standalone -r -i myAndroidXLib.aar -o supportLibVersion.aar\n```\n\n### Custom config file\n\nThe Jetifier tool uses a config file to map Support Library classes to their\nAndroidX equivalents. If necessary, you can make a custom config file that\nalters this mapping. You can even add new classes to the mapping that are not\nactually members of the Support Library. For example, you might modify the\nmapping to replace one of your own classes with a successor class written to use\nAndroidX.\n\nTo use a custom config file:\n\n1. Extract the file `default.generated.config` from the utility's `jetifier-core-*.jar` file and save it.\n2. Make any necessary edits to your copy of the config file.\n3. Pass your file to the utility with the `-c` flag.\n\nFor example: \n\n```\n./jetifier-standalone -i libraryToProcess.aar -o result.aar -c myCustomMapping.config\n```"]]