독립형 Jetifier 도구는 동등한 AndroidX 패키지를 대신 사용하도록 지원 라이브러리에 종속된 라이브러리를 이전합니다. 이 도구를 사용하면 Android 스튜디오와 함께 번들로 제공되는 Android Gradle 플러그인을 사용하는 대신 개별 라이브러리를 직접 이전할 수 있습니다.
Jetifier 설치
Jetifier를 설치하려면 ZIP 파일을 다운로드하여 압축을 풉니다. 기기에 자바 버전 1.8 이상이 설치되어 있어야 합니다.
사용
라이브러리를 처리하려면 도구에서 만들어야 하는 현재 라이브러리 경로 및 출력 파일 경로를 전달합니다. Jetifier는 중첩된 아카이브를 포함하여 JAR, AAR 및 ZIP 파일을 지원합니다.
Jetifier는 android.support.* 패키지를 가리키는 자바, XML, POM 및 ProGuard 참조를 이전하여 상응하는 androidx.* 패키지를 가리키도록 변경합니다.
android.support.*의 ProGuard 와일드 카드가 항상 androidx.* 패키지에 직접 매핑되는 것은 아니므로 Jetifier는 적합한 모든 대체 항목을 생성합니다.
android.support.* 패키지에 지원 라이브러리 아티팩트에서 제공되지 않는 유형이 있다면 Jetifier는 유형의 매핑이 있는 한 계속 이 유형을 이전합니다. 그러나 모든 맞춤 유형을 충분히 처리하는 일반적인 매핑 규칙이 없을 수 있으므로 이 이전의 작동은 보장되지 않습니다.
고급 사용법
Jetifier 유틸리티는 일부 고급 사용 사례를 지원합니다.
리버스 모드
-r 플래그를 전달하면 유틸리티는 리버스 모드로 실행됩니다. 이 모드에서 유틸리티는 AndroidX API를 동등한 지원 라이브러리로 변환합니다. 리버스 모드는 AndroidX API를 사용하는 라이브러리를 개발 중이지만 지원 라이브러리를 사용하는 버전을 배포해야 하는 경우 유용합니다.
예
다음 예에서는 현재 디렉터리의 myAndroidXLib.aar 라이브러리에서 리버스 모드로 유틸리티를 실행하여 동일한 디렉터리의 supportLibVersion.aar에 출력을 씁니다.
Jetifier 도구는 구성 파일을 사용하여 지원 라이브러리 클래스를 이에 상응하는 AndroidX 클래스에 매핑합니다. 필요한 경우 이 매핑을 변경하는 맞춤 구성 파일을 만들 수 있습니다. 실제로 지원 라이브러리의 멤버가 아닌 새 클래스를 매핑에 추가할 수도 있습니다. 예를 들어 자체 클래스 중 하나를 AndroidX를 사용하도록 작성된 후속 클래스로 대체하도록 매핑을 수정할 수 있습니다.
맞춤 구성 파일을 사용하려면 다음 단계를 따르세요.
유틸리티의 jetifier-core-*.jar 파일에서 default.generated.config 파일을 추출하여 저장합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","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"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],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```"]]