컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android Gradle 플러그인 3.1.0(2018년 3월)
이 버전의 Android 플러그인에는 다음이 필요합니다.
|
최소 버전 |
기본 버전 |
참고 |
Gradle |
4.4 |
4.4 |
자세한 내용은 Gradle 업데이트하기를 참고하세요. |
SDK 빌드 도구 |
27.0.3 |
27.0.3 |
SDK 빌드 도구를 설치 또는 구성합니다. 주의사항: android.buildToolsVersion 속성을 사용하여 빌드 도구의 버전을 더 이상 지정하지 않아도 됩니다. 플러그인은 필요한 최소 버전을 기본적으로 사용합니다. |
새로운 DEX 컴파일러, D8
이제 Android 스튜디오는 D8이라 부르는 새로운 DEX 컴파일러를 기본적으로 사용합니다. DEX 컴파일은 Android 런타임(이전 버전 Android의 경우 Dalvik)에서 .class
바이트 코드를 .dex
바이트 코드로 변환하는 프로세스입니다. 이전 컴파일러 DX와 비교할 때 D8은 더 빠르게 컴파일하고 더 작은 DEX 파일을 출력하면서 앱 런타임 성능은 동일하거나 더 좋게 유지합니다.
D8은 일상적인 앱 개발 워크플로를 변경하지 않습니다. 그러나 새로운 컴파일러와 관련된 문제가 발생하면 버그를 신고하세요. 프로젝트의 gradle.properties
파일에 다음을 포함하여 D8을 일시적으로 사용 중지하고 DX를 사용할 수 있습니다.
android.enableD8=false
자바 8 언어 기능을 사용하는 프로젝트의 경우 증분 디슈가링이 기본적으로 사용 설정됩니다. 프로젝트의 gradle.properties
파일에 다음을 지정하여 사용 중지할 수 있습니다.
android.enableIncrementalDesugaring=false.
미리보기 사용자: 이미 D8의 미리보기 버전을 사용하고 있다면 이제 JDK가 아니라 SDK 빌드 도구에 포함된 라이브러리에서 컴파일합니다. 따라서 JDK에는 있지만 SDK 빌드 도구 라이브러리에는 없는 API에 액세스하는 경우 컴파일 오류가 발생합니다.
동작 변경사항
-
각각 다른 ABI를 타겟팅하는 여러 APK를 빌드할 때 플러그인이 더 이상 mips
, mips64
, armeabi
ABI용 APK를 기본적으로 생성하지 않습니다.
이러한 ABI를 타겟팅하는 APK를 빌드하려면 NDK r16b 이하를 사용하고 아래와 같이 build.gradle
파일에 ABI를 지정해야 합니다.
splits {
abi {
include 'armeabi', 'mips', 'mips64'
...
}
}
splits {
abi {
include("armeabi", "mips", "mips64")
...
}
}
-
이제 Android 플러그인의 빌드 캐시가 30일 이상 된 캐시 항목을 제거합니다.
-
"auto"
를 resConfig
로 전달하면 더 이상 자동으로 문자열 리소스를 선택하여 APK로 패키징하지 않습니다.
계속해서 "auto"
를 사용하면 플러그인이 앱과 앱의 종속 항목이 제공하는 모든 문자열 리소스를 패키징합니다. 따라서 개발자는 플러그인을 통해 APK로 패키징하고자 하는 각 언어를 대신 지정해야 합니다.
-
로컬 모듈은 앱의 테스트 APK에 의존할 수 없기 때문에 androidTestImplementation
대신 androidTestApi
구성을 사용하여 계측 테스트에 종속 항목을 추가하면 Gradle에서 다음과 같은 경고가 발생합니다.
WARNING: Configuration 'androidTestApi' is obsolete
and has been replaced with 'androidTestImplementation'
WARNING: Configuration 'androidTestApi' is obsolete
and has been replaced with 'androidTestImplementation'
수정사항
- Android 스튜디오가 복합 빌드의 종속 항목을 적절히 인식하지 못하는 문제를 해결했습니다.
- 단일 빌드에서 Android 플러그인을 여러 번 로드할 때 프로젝트 동기화 오류가 발생하는 문제를 해결했습니다. 예: 여러 하위 프로젝트가 빌드 스크립트 클래스 경로에 Android 플러그인을 각각 포함하는 경우
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-30(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-30(UTC)"],[],[],null,["\u003cbr /\u003e\n\nAndroid Gradle Plugin 3.1.0 (March 2018)\n\nThis version of the Android plugin requires the following:\n\n| | Minimum version | Default version | Notes |\n|----------------:|:---------------:|:---------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|\n| Gradle | 4.4 | 4.4 | To learn more, see [updating Gradle](/build/releases/gradle-plugin?buildsystem=ndk-build#updating-gradle). |\n| SDK Build Tools | 27.0.3 | 27.0.3 | [Install](/studio/intro/update#sdk-manager) or [configure](/tools/releases/build-tools) SDK Build Tools. Keep in mind, you no longer need to specify a version for the build tools using the android.buildToolsVersion property---the plugin uses the minimum required version by default. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nNew DEX compiler, D8\n\nBy default, Android Studio now uses a new DEX compiler called D8. DEX\ncompilation is the process of transforming `.class` bytecode into\n`.dex` bytecode for the Android Runtime (or Dalvik, for older\nversions of Android). Compared to the previous compiler, called DX, D8\ncompiles faster and outputs smaller DEX files, all while having the same or\nbetter app runtime performance.\n\nD8 shouldn't change your day-to-day app development workflow. However, if\nyou experience any issues related to the new compiler, please\n[report a bug](/studio/report-bugs). You can temporarily\ndisable D8 and use DX by including the following in your project's\n`gradle.properties` file: \n\n android.enableD8=false\n \nFor projects that\n[use Java 8 language features](/studio/write/java8-support),\nincremental desugaring is enabled by default. You can disable it by\nspecifying the following in your project's `gradle.properties` file: \n\n android.enableIncrementalDesugaring=false.\n \n\n**Preview users:** If you're already using a preview version of D8, note\nthat it now compiles against libraries included in the\n[SDK build tools](/studio/releases/build-tools)---not the JDK.\nSo, if you are accessing APIs that exist in the JDK but not in the SDK build\ntools libraries, you get a compile error.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nBehavior changes\n\n- When building multiple APKs that each target a different ABI, the\n no longer generates APKs for the following ABIs by default:\n `mips`, `mips64`, and `armeabi`.\n\n If you want to build APKs that target these ABIs, you must use\n [NDK r16b or lower](/ndk/downloads/revision_history) and\n specify the ABIs in your `build.gradle` file, as shown below: \n\n ```groovy\n splits {\n abi {\n include 'armeabi', 'mips', 'mips64'\n ...\n }\n }\n \n ``` \n\n ```kotlin\n splits {\n abi {\n include(\"armeabi\", \"mips\", \"mips64\")\n ...\n }\n }\n \n ```\n- The Android plugin's [build\n cache](/studio/build/build-cache) now evicts cache entries that are older than 30 days.\n\n- Passing `\"auto\"` to\n [`resConfig`](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.ProductFlavor.html#com.android.build.gradle.internal.dsl.ProductFlavor:resConfig(java.lang.String))\n no longer automatically picks string resources to package into your APK.\n If you continue to use `\"auto\"`, the plugin packages all string\n resources your app and its dependencies provide. So, you should instead\n specify each locale that you want the plugin to package into your APK.\n\n- Because local modules can't depend on your app's test APK, adding\n dependencies to your instrumented tests using the\n `androidTestApi` configuration, instead of\n `androidTestImplementation`, causes Gradle to issue the\n following warning:\n\n ```groovy\n WARNING: Configuration 'androidTestApi' is obsolete\n and has been replaced with 'androidTestImplementation'\n \n ``` \n\n ```kotlin\n WARNING: Configuration 'androidTestApi' is obsolete\n and has been replaced with 'androidTestImplementation'\n \n ```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nFixes\n\n- Fixes an issue where Android Studio doesn't properly recognize dependencies in composite builds.\n- Fixes an issue where you get a project sync error when loading the Android plugin multiple times in a single build--for example, when multiple subprojects each include the Android plugin in their buildscript classpath.\n\n\u003cbr /\u003e"]]