지원 라이브러리 설정
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
참고: Android 9.0(API 수준 28)의 출시와 함께 Jetpack의 일부인 새로운 버전의 지원 라이브러리 AndroidX가 출시됩니다.
AndroidX 라이브러리는 기존 지원 라이브러리를 포함하며 최신 Jetpack 구성요소 또한 포함합니다.
지원 라이브러리를 계속 사용할 수 있습니다.
이전 아티팩트(버전 27 이상이며 android.support.*
로 패키징됨)는 Google Maven에서 계속 사용할 수 있습니다. 그러나 모든 새 라이브러리 개발은 AndroidX 라이브러리에서 진행됩니다.
모든 신규 프로젝트에서 AndroidX 라이브러리를 사용하는 것이 좋습니다. 기존 프로젝트를 AndroidX로 이전하는 것 또한 고려해보세요.
개발 프로젝트에서 Android 지원 라이브러리를 설정하는 방법은 사용할 기능과 애플리케이션으로 지원할 Android 플랫폼 버전 범위에 따라 다릅니다.
이 문서에서는 지원 라이브러리 패키지를 다운로드하고 개발 환경에 라이브러리를 추가하는 과정을 안내합니다.
지원 라이브러리는 이제 Google의 Maven 저장소를 통해서 사용할 수 있습니다. 더 이상 SDK 관리자를 통한 라이브러리 다운로드를 지원하지 않으며 이 기능은 곧 삭제됩니다.
지원 라이브러리 선택
지원 라이브러리를 애플리케이션에 추가하기 전에 포함할 기능과 지원할 가장 낮은 Android 버전을 결정하세요. 서로 다른 라이브러리가 제공하는 기능에 관해 자세히 알아보려면 지원 라이브러리 기능을 참고하세요.
지원 라이브러리 추가
지원 라이브러리를 사용하려면 개발 환경 내 애플리케이션 프로젝트의 클래스 경로 종속성을 수정해야 합니다. 사용할 지원 라이브러리마다 이 절차를 진행해야 합니다.
지원 라이브러리를 애플리케이션 프로젝트에 추가하려면 다음 단계를 따르세요.
- 프로젝트의
settings.gradle
파일에 Google의 Maven 저장소를 포함합니다.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must
// instead use:
//
// maven {
// url 'https://maven.google.com'
// }
}
}
- 지원 라이브러리를 사용할 각 모듈에서
build.gradle
파일의 dependencies
블록에 라이브러리를 추가합니다. 예를 들어 v4 core-utils 라이브러리를 추가하려면 다음을 추가합니다.
dependencies {
...
implementation "com.android.support:support-core-utils:28.0.0"
}
주의: 동적 종속 항목 (예: palette-v7:23.0.+
)을 사용하면 예기치 않은 버전 업데이트와 이전 버전과의 비호환성이 발생할 수 있습니다. 예를 들어 palette-v7:28.0.0
처럼 명시적으로 라이브러리 버전을 지정하는 것이 좋습니다.
지원 라이브러리 API 사용
기존 프레임워크 API를 지원하는 지원 라이브러리 클래스는 일반적으로 프레임워크 클래스와 같은 이름을 가지고 있으나 android.support
클래스 패키지에 위치하거나 *Compat
접미사가 붙습니다.
주의: 지원 라이브러리의 클래스를 사용하는 경우 적절한 패키지에서 클래스를 가져와야 합니다. 예를 들어 ActionBar
클래스를 적용하는 경우 다음을 사용합니다.
- 지원 라이브러리를 사용하는 경우
android.support.v7.app.ActionBar
- API 수준 11 이상용으로만 개발 중인 경우
android.app.ActionBar
참고: 애플리케이션 프로젝트에 지원 라이브러리를 포함한 후 출시를 위해 앱을 축소, 난독화, 최적화하는 것이 좋습니다. 난독화를 통해 소스 코드가 보호될 뿐만 아니라, 축소를 통해 애플리케이션에 포함된 라이브러리에서 사용되지 않는 클래스를 제거하여 애플리케이션의 다운로드 크기를 최소한으로 만듭니다.
일부 지원 라이브러리 기능 사용에 관한 더 자세한 안내는 Android 개발자 교육 과정, 가이드 및 샘플에서 제공합니다. 개별 지원 라이브러리 클래스 및 메서드에 관한 자세한 내용은 API 참조에서 android.support
패키지를 참고하세요.
매니페스트 선언 변경
지원 라이브러리를 사용하여 기존 애플리케이션과 Android API 이전 버전과의 호환성을 높이려면 애플리케이션 매니페스트를 업데이트해야 합니다. 특히, 아래와 같이 매니페스트에서
<uses-sdk>
태그의 android:minSdkVersion
요소를 새로운 하위 버전 번호로 업데이트해야 합니다.
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />
이 매니페스트 설정은 애플리케이션이 Android 4.0 (API 수준 14) 이상 기기에 설치될 수 있음을 Google Play에 알립니다.
Gradle 빌드 파일을 사용하는 경우 빌드 파일의 minSdkVersion
설정이 매니페스트 설정을 재정의합니다.
plugins {
id 'com.android.application'
}
android {
...
defaultConfig {
minSdkVersion 16
...
}
...
}
이 경우 빌드 파일 설정은 애플리케이션의 기본 빌드 변형이 Android 4.1 (API 수준 16) 이상 기기에 설치될 수 있음을 Google Play에 알립니다. 빌드 변형에 관한 자세한 내용은 빌드 시스템 개요를 참고하세요.
참고: 지원 라이브러리를 여러 개 추가하는 경우 최소 SDK 버전은 명시된 라이브러리가 요구하는 최상위 버전이어야 합니다. 예를 들어 앱에 v14 환경설정 지원 라이브러리와 v17 Leanback 라이브러리가 포함되는 경우, 최소 SDK 버전은 17 이상이어야 합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-21(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-08-21(UTC)"],[],[],null,["# Support Library Setup\n\n**Note:** With the release of Android 9.0 (API level 28) there is\na new version of the support library called\n[AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack).\nThe AndroidX library\ncontains the existing support library and also includes the latest Jetpack components.\n\n\u003cbr /\u003e\n\n\nYou can continue to use the support library.\nHistorical artifacts (those versioned 27 and earlier, and packaged as `android.support.*`) will\nremain available on Google Maven. However, all new library development\nwill occur in the [AndroidX](/jetpack/androidx) library.\n\n\u003cbr /\u003e\n\n\nWe recommend using the AndroidX libraries in all new projects. You should also consider\n[migrating](/jetpack/androidx/migrate) existing projects to AndroidX as well.\n\nHow you setup the Android Support Libraries in your development project depends on what features\nyou want to use and what range of Android platform versions you want to support with your\napplication.\n\nThis document guides you through downloading the Support Library package and adding libraries\nto your development environment.\n\nThe support libraries are now available through Google's Maven\nrepository. We no longer support downloading the libraries through the SDK\nManager, and that functionality will be removed soon..\n\nChoosing Support Libraries\n--------------------------\n\nBefore adding a Support Library to your application, decide what features you want to include\nand the lowest Android versions you want to support. For more information on the features\nprovided by the different libraries, see\n[Support Library Features](/tools/support-library/features).\n\nAdding Support Libraries\n------------------------\n\nIn order to use a Support Library, you must modify your application's project's\nclasspath dependencies within your development environment. You must perform this procedure for\neach Support Library you want to use.\n\nTo add a Support Library to your application project:\n\n1. Include Google's Maven repository in your project's `settings.gradle` file. \n\n ```groovy\n dependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories {\n google()\n\n // If you're using a version of Gradle lower than 4.1, you must\n // instead use:\n //\n // maven {\n // url 'https://maven.google.com'\n // }\n }\n }\n ```\n2. For each module in which you want to use a Support Library, add the library in the `dependencies` block of the module's `build.gradle` file. For example, to add the v4 core-utils library, add the following: \n\n ```groovy\n dependencies {\n ...\n implementation \"com.android.support:support-core-utils:28.0.0\"\n }\n ```\n\n\n**Caution:** Using dynamic dependencies (for example,\n`palette-v7:23.0.+`) can cause unexpected version updates and\nregression incompatibilities. We recommend that you explicitly specify a\nlibrary version (for example, `palette-v7:28.0.0`).\n\nUsing Support Library APIs\n--------------------------\n\nSupport Library classes that provide support for existing framework APIs typically have the\nsame name as framework class but are located in the `android.support` class packages,\nor have a `*Compat` suffix. \n**Caution:** When using classes from the Support Library, be certain you import\nthe class from the appropriate package. For example, when applying the `ActionBar`\nclass:\n\n- `android.support.v7.app.ActionBar` when using the Support Library.\n- `android.app.ActionBar` when developing only for API level 11 or higher.\n\n\n**Note:** After including the Support Library in your application project, we\nstrongly recommend that you [shrink, obfuscate, and optimize\nyour app](/studio/build/shrink-code) for release. In addition to protecting your source code with obfuscation, shrinking\nremoves unused classes from any libraries you include in your application, which keeps the\ndownload size of your application as small as possible.\n\nFurther guidance for using some Support Library features is provided in the Android developer\n[training classes](/training),\n[guides](/guide/components)\nand samples. For more information about the individual Support Library classes and methods, see\nthe [android.support](/reference/android/support/v4/app/package-summary) packages in the API reference.\n\n### Manifest Declaration Changes\n\nIf you are increasing the backward compatibility of your existing application to an earlier\nversion of the Android API with the Support Library, make sure to update your application's\nmanifest. Specifically, you should update the `android:minSdkVersion`\nelement of the [`\u003cuses-sdk\u003e`](/guide/topics/manifest/uses-sdk-element) tag in the manifest to the new, lower version number, as\nshown below: \n\n```xml\n \u003cuses-sdk\n android:minSdkVersion=\"14\"\n android:targetSdkVersion=\"23\" /\u003e\n```\n\nThe manifest setting tells Google Play that your application can be installed on devices with Android\n4.0 (API level 14) and higher.\n\nIf you are using Gradle build files, the `minSdkVersion` setting in the build file\noverrides the manifest settings. \n\n```groovy\nplugins {\n id 'com.android.application'\n}\n\nandroid {\n ...\n\n defaultConfig {\n minSdkVersion 16\n ...\n }\n ...\n}\n```\n\nIn this case, the build file setting tells Google Play that the default build variant of your\napplication can be installed on devices with Android 4.1 (API level 16) and higher. For more\ninformation about build variants, see\n[Build System Overview](/studio/build).\n\n\n**Note:** If you are including several support libraries, the\nminimum SDK version must be the *highest* version required by any of\nthe specified libraries. For example, if your app includes both the [v14 Preference Support library](/topic/libraries/support-library/features#v14-preference) and the\n[v17 Leanback library](/topic/libraries/support-library/features#v17-leanback), your minimum\nSDK version must be 17 or higher."]]