Android 스튜디오를 사용하거나 R8 빌드 메타데이터를 확인하여 시작 프로필이 작동하는지 확인할 수 있습니다.
Android 스튜디오에서 확인
DEX 레이아웃 최적화를 확인하려면 Android 스튜디오를 사용하여 APK를 열고 DEX 파일의 클래스를 확인합니다. 기본 classes.dex가 완전히 채워지지 않았는지 확인합니다. 앱이 단일 DEX 파일로 구성된 경우 시작 프로필을 사용 설정한 후 앱에 DEX 파일이 두 개 포함되어 있는지 확인할 수 있습니다.
시작 클래스가 단일 DEX 파일에 맞지 않으면 Android 스튜디오에서 경고를 표시합니다.
시작 클래스의 시작 외 메서드 수가 포함된 진단 정보를 가져오려면 시작 프로필을 적용할 때 settings.gradle 파일을 다음과 같이 변경하여 R8 컴파일러가 최소 버전 8.3.36-dev로 업데이트되었는지 확인하세요.
해시 값을 1단계의 'checksum' 값과 비교합니다. SHA-256 값이 일치하지 않으면 컴파일 단계가 R8의 DEX 파일 출력 기능을 방해하는 것일 수 있습니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Confirm Startup Profiles optimization\n\nYou can check that your Startup Profiles are working using either Android Studio\nor looking at the R8 build metadata.\n\nConfirm with Android Studio\n---------------------------\n\nTo confirm DEX layout optimization, use Android Studio to open the APK and\nverify the classes in the DEX files. Make sure the primary `classes.dex` isn't\ncompletely filled. If your app consists of a single DEX file, you can check\nwhether the app contains two DEX files after enabling the Startup Profile.\n\nAndroid Studio warns you if the startup classes don't fit in a single DEX file.\nTo get diagnostic information that includes the amount of non-startup methods in\nthe startup classes, make sure the R8 compiler is updated to at least version\n8.3.36-dev by making the following changes to the `settings.gradle` file when\nyou apply the Startup Profile: \n\n### Kotlin\n\n```kotlin\npluginManagement {\n buildscript {\n repositories {\n mavenCentral()\n maven {\n url = uri(\"https://storage.googleapis.com/r8-releases/raw\")\n }\n }\n dependencies {\n classpath(\"com.android.tools:r8:8.3.6-dev\")\n }\n }\n}\n```\n\n### Groovy\n\n```groovy\npluginManagement {\n buildscript {\n repositories {\n mavenCentral()\n maven {\n url uri('https://storage.googleapis.com/r8-releases/raw')\n }\n }\n dependencies {\n classpath 'com.android.tools:r8:8.3.6-dev\"\n }\n }\n}\n```\n\nMake sure you add `--info` after\n`assembleRelease` in the following command when building with Gradle. \n\n ./gradlew assembleRelease --info\n\nThe diagnostic is then printed to the terminal.\n\nIf your app or any libraries reference any [desugared APIs](/studio/write/java8-support#library-desugaring), the bundled\ncompatibility implementations of these classes are always contained in the last\nDEX file. This desugared last DEX file doesn't participate in DEX layout\noptimizations.\n\nConfirm with bundle metadata\n----------------------------\n\n| **Note:** This workflow has only been tested on Linux.\n\nStarting with AGP 8.8, R8 outputs metadata in your Android App Bundle (AAB) that\nyou can use to check if the DEX layout optimization was successful. To check if\nthe optimization worked, do the following:\n\n1. Build your app's AAB:\n\n ./gradlew app:bundleRelease\n\n2. Check that there's at least one DEX file that contains the text\n `\"startup\": true`.\n\n 1. Open the metadata:\n\n unzip -j -o \u003cvar translate=\"no\"\u003epath-to-aab\u003c/var\u003e BUNDLE-METADATA/com.android.tools/r8.json && jq .dexFiles r8.json\n\n The path to your AAB might be something like\n `app/build/outputs/bundle/release/app-release.aab`.\n 2. Check the output, which should look something like this:\n\n inflating: r8.json\n [\n {\n \"checksum\": \"f0b4b0ddb295812607f44efe03cf7a830056ccfddbdb81db3760d2281940e951\",\n \"startup\": true\n }\n ]\n\n If you only see `\"startup\": false` in the metadata, you need to\n [enable startup profiles](/topic/performance/baselineprofiles/dex-layout-optimizations#create-startup) and ensure that your startup\n profile isn't obfuscated.\n3. Check that the SHA-256 values from the metadata match those from the AAB. To\n get the SHA-256 values for all your DEX files run the following:\n\n unzip -o \u003cvar translate=\"no\"\u003epath-to-aab\u003c/var\u003e */dex/*.dex && sha256sum */dex/*\n\n The output should look something like this: \n\n Archive: app/build/outputs/bundle/release/myapp-release.aab\n inflating: base/dex/classes.dex\n f0b4b0ddb295812607f44efe03cf7a830056ccfddbdb81db3760d2281940e951 base/dex/classes.dex\n\n Compare the hash values to the \"checksum\" values from step 1. If the SHA-256\n values don't match, there might be a compilation step interfering with R8's\n ability to output DEX files."]]