기본 모듈 구성
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
App Bundle은 기기에 배포할 수 없다는 점에서 APK와 다릅니다. 정확히 말해 App Bundle은 앱의 모든 컴파일된 코드 및 리소스를 단일 빌드 아티팩트에 포함하는 게시 형식입니다. 따라서 서명된 App Bundle을 업로드하면 Google Play는 앱의 APK를 빌드하고 서명하며 사용자에게 제공하는 데 필요한 모든 것을 갖추게 됩니다.
시작하기
대부분의 앱 프로젝트에서는 큰 노력을 기울이지 않고 간편하게 Android App Bundle을 지원할 수 있습니다.
그 이유는 앱의 기본 APK용 코드 및 리소스를 포함하는 모듈이 표준 앱 모듈이므로 Android 스튜디오에서 새로운 앱 프로젝트를 생성할 때 기본적으로 제공되기 때문입니다.
즉, 아래의 application
플러그인을 다음 종속 항목에 적용하는 모듈입니다.
기본 기능의 코드와 리소스를 제공하는 build.gradle
파일
있습니다.
Groovy
// The standard application plugin creates your app's base module.
plugins {
id 'com.android.application'
}
Kotlin
plugins {
// The standard application plugin creates your app's base module.
id("com.android.application")
}
기본 모듈은 앱의 핵심 기능을 제공하는 것 외에도 앱 프로젝트 전체에 영향을 주는 여러 빌드 구성 및 매니페스트 항목도 제공합니다.
기본 모듈 빌드 구성
대부분의 기존 앱 프로젝트에서는 기본 모듈의 빌드 구성을 바꾸지 않아도 됩니다. 하지만 Cloud Functions에
이전에 버전 3을 사용하여 앱을 출시한 경우
기본 모듈의 빌드 구성에 몇 가지 측면이 있음
몇 가지 옵션이 있습니다
버전 코드 및 앱 업데이트
Android App Bundle을 사용하면 더 이상 Google Play에 업로드하는 여러 APK의 버전 코드를 관리하지 않아도 됩니다. 대신 아래와 같이 앱의 기본 모듈에서 하나의 버전 코드만 관리합니다.
// In your base module build.gradle file
android {
defaultConfig {
…
// You specify your app’s version code only in the base module.
versionCode 5
versionName "1.0"
}
}
App Bundle을 업로드하면 Google Play가 기본 모듈에 있는 버전 코드를 사용하여 App Bundle에서 생성한 모든 APK에 동일한 버전 코드를 할당합니다. 즉, 기기에 앱을 다운로드하여 설치하면 앱의 모든 분할 APK가 동일한 버전 코드를 공유합니다.
새 코드나 리소스로 앱을 업데이트하려면 반드시 앱 기본 모듈의 버전 코드를 업데이트하고 새 App Bundle 전체를 빌드해야 합니다.
빌드한 App Bundle을 Google Play에 업로드하면 기본 모듈에서 지정한 버전 코드를 기반으로 APK의 새로운 세트가 생성됩니다. 그 후에 사용자가 앱을 업데이트하면 Google Play에서 현재 기기에 설치된 모든 APK의 업데이트 버전을 제공합니다. 즉, 설치된 모든 APK가 새로운 버전 코드로 업데이트됩니다.
기타 고려사항
- 앱 서명: 빌드 파일에 서명 정보를 포함하는 경우
기본 모듈의 빌드 구성 파일에만 포함해야 합니다.
자세한 내용은
앱에 서명하도록 Gradle을 구성합니다.
- 코드 축소: 전체 앱 프로젝트(기능 모듈 포함)에 코드 축소를 사용 설정하려면 반드시 기본 모듈의 build.gradle 파일에서 해야 합니다. 즉, 맞춤 ProGuard 규칙을 기능 모듈에 포함할 수는 있지만 기능 모듈 빌드 구성의
minifyEnabled
속성은 무시됩니다.
splits
블록이 무시됨: App Bundle을 빌드할 때 Gradle은 android.splits
블록에 있는 속성을 무시합니다. App Bundle이 지원하는 구성 APK 유형을 제어하려면 대신 android.bundle
을 사용하여 구성 APK 유형을 사용 중지합니다.
- 앱 버전 관리: 기본 모듈이 전체 앱 프로젝트의 버전 코드와 버전 이름을 결정합니다. 자세한 내용은 앱 업데이트 관리 방법 섹션을 참조하세요.
구성 APK 유형을 다시 사용 또는 사용 중지
기본적으로 App Bundle을 빌드할 때 App Bundle은 언어 리소스, 화면 밀도 리소스 및 ABI 라이브러리 세트마다 구성 APK를 생성하도록 지원합니다. 아래와 같이 기본 모듈의 build.gradle
파일에서 android.bundle
블록을 사용하여 하나 이상의 구성 APK 유형 지원을 중지할 수 있습니다.
Groovy
android {
// When building Android App Bundles, the splits block is ignored.
// You can remove it, unless you're going to continue to build multiple
// APKs in parallel with the app bundle
splits {...}
// Instead, use the bundle block to control which types of configuration APKs
// you want your app bundle to support.
bundle {
language {
// This property is set to true by default.
// You can specify `false` to turn off
// generating configuration APKs for language resources.
// These resources are instead packaged with each base and
// feature APK.
// Continue reading below to learn about situations when an app
// might change setting to `false`, otherwise consider leaving
// the default on for more optimized downloads.
enableSplit = false
}
density {
// This property is set to true by default.
enableSplit = true
}
abi {
// This property is set to true by default.
enableSplit = true
}
}
}
Kotlin
android {
// When building Android App Bundles, the splits block is ignored.
// You can remove it, unless you're going to continue to build multiple
// APKs in parallel with the app bundle
splits {...}
// Instead, use the bundle block to control which types of configuration APKs
// you want your app bundle to support.
bundle {
language {
// This property is set to true by default.
// You can specify `false` to turn off
// generating configuration APKs for language resources.
// These resources are instead packaged with each base and
// feature APK.
// Continue reading below to learn about situations when an app
// might change setting to `false`, otherwise consider leaving
// the default on for more optimized downloads.
enableSplit = false
}
density {
// This property is set to true by default.
enableSplit = true
}
abi {
// This property is set to true by default.
enableSplit = true
}
}
}
언어 변경 처리
Google Play는 앱을 기반으로 설치할 언어 리소스를 결정합니다.
사용자의 기기 설정에서 언어 선택에 따라 달라집니다. 다음과 같은 사용자를 생각해 보세요.
사용자가 이미 앱을 다운로드한 후 기본 시스템 언어를 변경할 수 있습니다.
앱에서 해당 언어를 지원하는 경우 기기에서
구성 APK를 다운로드할 수 있습니다.
애플리케이션 내에서 언어 선택 도구를 제공하고 동적으로
시스템 수준의 언어 설정과 관계없이 앱의 언어 변경
리소스 누락으로 인한 비정상 종료를 방지하기 위해 몇 가지 사항을 변경해야 합니다. 둘 중 하나
android.bundle.language.enableSplit
속성을 false
로 설정하거나
다음과 같이 Play Core 라이브러리를 사용하여 주문형 언어 다운로드를 구현합니다.
추가 언어 리소스 다운로드에 설명된 대로
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 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,["# Configure the base module\n\nAn app bundle is different from an APK in that you can't deploy one to a\ndevice. Rather, it's a publishing format that includes all your app's compiled\ncode and resources in a single build artifact. So, after you upload your\nsigned app bundle, Google Play has everything it needs to build and sign your\napp's APKs, and serve them to users.\n\nGet started\n-----------\n\nMost app projects won't require much effort to support Android App Bundles.\nThat's because the module that includes code and resources for your app's base\nAPK is the standard app module, which you get by default when you\n[create a new app project in Android Studio](/studio/projects/create-project).\nThat is, the module that applies the `application` plugin below to its\n`build.gradle` file provides the code and resources for the base functionality\nof your app. \n\n### Groovy\n\n```groovy\n// The standard application plugin creates your app's base module.\nplugins {\n id 'com.android.application'\n}\n```\n\n### Kotlin\n\n```kotlin\nplugins {\n // The standard application plugin creates your app's base module.\n id(\"com.android.application\")\n}\n```\n\nIn addition to providing the core functionality for your app, the base module\nalso provides many of the build configurations and manifest entries that\naffect your entire app project.\n\nThe base module build configuration\n-----------------------------------\n\nFor most existing app projects, you don't need to change anything in your base\nmodule's build configuration. However, if you are considering adding\nfeature modules to your app project or if you previously released your app using\nmultiple APKs, there are some aspects to the base module's build configuration\nthat you should keep in mind.\n\n### Version code and app updates\n\nWith Android App Bundles, you no longer have to manage\nversion codes for multiple APKs that you upload to Google Play. Instead, you\nmanage only one version code in the base module of your app, as shown below: \n\n // In your base module build.gradle file\n android {\n defaultConfig {\n ...\n // You specify your app's version code only in the base module.\n versionCode 5\n versionName \"1.0\"\n }\n }\n\nAfter you upload your app bundle, Google Play uses the version code in your\nbase module to assign the same version code to all the APKs it generates from\nthat bundle. That is, when a device downloads and installs your app, all split\nAPKs for that app share the same version code.\n\nWhen you want to update your app with new code or resources, you must update\nthe version code in your app's base module, and build a new, full app bundle.\nWhen you upload that app bundle to Google Play, it generates a new set of APKs\nbased on the version code the base module specifies. Subsequently, when users\nupdate your app, Google Play serves them updated versions of all APKs\ncurrently installed on the device. That is, all installed APKs are updated to\nthe new version code.\n\n### Other considerations\n\n- **App signing:** If you include signing information in your build files, you should only include it in the base module's build configuration file. For more information, see [Configure Gradle to sign your app](/studio/publish/app-signing#gradle-sign).\n- **Code shrinking:** If you want to [enable code shrinking](/studio/build/shrink-code#shrink-code) for your entire app project (including its feature modules), you must do so from the base module's build.gradle file. That is, you can include custom ProGuard rules in a feature module, but the `minifyEnabled` property in feature module build configurations is ignored.\n- **The `splits` block is ignored:** When building an app bundle, Gradle ignores properties in the `android.splits` block. If you want to control which types of configuration APKs your app bundle supports, instead use `android.bundle` to [disable types of configuration APKs](#disable_config_apks).\n- **App versioning:** The base module determines the version code and version name for your entire app project. For more information, go to the section about how to [Manage app updates](#manage_app_updates).\n\n### Re-enable or disable types of configuration APKs\n\nBy default, when you build an app bundle, it supports generating configuration\nAPKs for each set of language resources, screen density resources, and ABI\nlibraries. Using the `android.bundle` block in your base module's\n`build.gradle` file, as shown below, you can disable support for one or more\ntypes of configuration APKs: \n\n### Groovy\n\n```groovy\nandroid {\n // When building Android App Bundles, the splits block is ignored.\n // You can remove it, unless you're going to continue to build multiple\n // APKs in parallel with the app bundle\n splits {...}\n\n // Instead, use the bundle block to control which types of configuration APKs\n // you want your app bundle to support.\n bundle {\n language {\n // This property is set to true by default.\n // You can specify `false` to turn off\n // generating configuration APKs for language resources.\n // These resources are instead packaged with each base and\n // feature APK.\n // Continue reading below to learn about situations when an app\n // might change setting to `false`, otherwise consider leaving\n // the default on for more optimized downloads.\n enableSplit = false\n }\n density {\n // This property is set to true by default.\n enableSplit = true\n }\n abi {\n // This property is set to true by default.\n enableSplit = true\n }\n }\n}\n```\n\n### Kotlin\n\n```kotlin\nandroid {\n // When building Android App Bundles, the splits block is ignored.\n // You can remove it, unless you're going to continue to build multiple\n // APKs in parallel with the app bundle\n splits {...}\n\n // Instead, use the bundle block to control which types of configuration APKs\n // you want your app bundle to support.\n bundle {\n language {\n // This property is set to true by default.\n // You can specify `false` to turn off\n // generating configuration APKs for language resources.\n // These resources are instead packaged with each base and\n // feature APK.\n // Continue reading below to learn about situations when an app\n // might change setting to `false`, otherwise consider leaving\n // the default on for more optimized downloads.\n enableSplit = false\n }\n density {\n // This property is set to true by default.\n enableSplit = true\n }\n abi {\n // This property is set to true by default.\n enableSplit = true\n }\n }\n}\n```\n\n### Handling language changes\n\nGoogle Play determines which language resources to install with the app based\non the language selection in the user's device settings. Consider a user who\nchanges their default system language after already downloading your app.\nIf your app supports that language, the device requests and downloads additional\nconfiguration APKs for those language resources from Google Play.\n\nFor apps that offer a language picker inside the application and dynamically\nchange the app's language, independent of the system level language setting,\nyou must make some changes to prevent crashes due to missing resources. Either\nset the `android.bundle.language.enableSplit` property to `false`, or consider\nimplementing on-demand language downloads using the Play Core library as\ndescribed in [Download additional language resources](/guide/playcore/feature-delivery/on-demand#lang_resources)"]]