Android 소비자 SDK 3.0 이전 가이드
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Kotlin 2.0으로 이전
Android용 Consumer SDK 3.0 이상을 사용하는 경우 Kotlin 2.0으로 업그레이드해야 합니다. 이 페이지에서는 새 Kotlin 버전으로의 전환을 용이하게 하는 가이드를 제공합니다.
Gradle 및 AGP 호환성
Kotlin 2.0에는 Gradle 및 Android Gradle 플러그인 (AGP) 버전의 최소 및 최대 버전 요구사항이 있습니다. 프로젝트가 Kotlin 2.0의 다음 요구사항을 충족하는지 확인하세요.
Consumer SDK 3.0 이상의 AGP 최소 버전
Consumer SDK 3.0을 사용하려면 AGP 7.3 이상을 사용해야 합니다.
전체 R8 모드
소비자 SDK v3 이하에서는 전체 R8 모드를 지원하지 않습니다. 애플리케이션이 AGP 8.0 이상을 타겟팅하는 경우 전체 R8 모드를 명시적으로 사용 중지해야 합니다.
# settings.gradle
android.enableR8.fullMode=false
Kotlin 버전 호환성
Kotlin은 이전 언어 버전 3개와의 하위 호환성을 지원합니다.
즉, Consumer SDK와 함께 Kotlin 1.7 이상을 이미 사용하고 있다면 모든 호환성 중단 변경사항을 해결하지 않고도 Kotlin 2.0으로 업그레이드할 수 있습니다. 하지만 Kotlin 호환성은 안정적인 언어 기능에만 적용됩니다.
Kotlin 언어에서 알파, 베타 또는 실험용 기능을 사용하는 경우 업그레이드할 때 추가 변경사항이 필요할 수 있습니다.
Kotlin 호환성 플래그
이전 섹션에서 설명한 대로 Kotlin은 업그레이드 시 최대 3개의 이전 언어 버전을 지원합니다. Kotlin은 호환성을 파괴하는 변경사항을 제한하는 데 도움이 되는 두 가지 플래그를 제공합니다.
언어 버전 X.Y
이 플래그는 이전 Kotlin 버전의 동작에 대한 호환성이 깨지는 변경사항을 되돌립니다.
예를 들어 Kotlin 1.7을 사용하는 경우 [ -
language-version 1.7]
을 지정하면 새로운 호환성 중단 변경사항이 더 이상 적용되지 않습니다.
android {
kotlinOptions {
languageVersion = '1.7'
}
}
api-version X.Y
이 플래그는 종속 다운스트림 코드가 Kotlin 2.0을 통합할 준비가 되기 전에 새 API가 사용되지 않도록 합니다.
android {
kotlinOptions {
apiVersion = '1.7'
}
}
더욱 타겟팅된 접근 방식
Kotlin 호환성 플래그를 사용하는 것 외에도 Kotlin 출시 노트를 검토하고 업그레이드하는 버전에서 유지하려는 동작을 선택하는 것이 좋습니다. Kotlin은 각 버전의 호환성 가이드에서 호환성이 깨지는 변경사항 목록과 원래 동작을 유지하기 위해 설정할 수 있는 플래그를 제공합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eUpgrading to Kotlin 2.0 is mandatory when utilizing the Consumer SDK for Android 3.0 or later.\u003c/p\u003e\n"],["\u003cp\u003eEnsure your Gradle and Android Gradle Plugin (AGP) versions meet the compatibility requirements for Kotlin 2.0, with Consumer SDK 3.0+ necessitating AGP 7.3 or higher.\u003c/p\u003e\n"],["\u003cp\u003eDisable Full R8 mode explicitly for Consumer SDK v3 and below when targeting AGP 8.0+.\u003c/p\u003e\n"],["\u003cp\u003eWhile Kotlin generally offers backward compatibility, potential breaking changes might require adjustments, especially when using alpha, beta, or experimental Kotlin features.\u003c/p\u003e\n"],["\u003cp\u003eLeverage Kotlin compatibility flags like \u003ccode\u003elanguage-version\u003c/code\u003e and \u003ccode\u003eapi-version\u003c/code\u003e or consult the Kotlin compatibility guides for managing specific breaking changes during the upgrade.\u003c/p\u003e\n"]]],["To migrate to Kotlin 2.0 with Consumer SDK 3.0+, ensure your Gradle and AGP versions meet Kotlin 2.0 requirements (AGP 7.3+). Disable Full R8 mode if using AGP 8.0+ by setting `android.enableR8.fullMode=false` in `settings.gradle`. Utilize Kotlin compatibility flags, `languageVersion` and `apiVersion`, to revert breaking changes or limit new API usage. Consult the Kotlin compatibility guides for specific version changes and behavior flags.\n"],null,["Migrate to Kotlin 2.0\n\nIf you are using the Consumer SDK for Android 3.0+ you must upgrade to Kotlin\n2.0. This page provides guidance to ease the transition to the new Kotlin\nversion.\n| **Note:** For information on upgrading to Kotlin 1.9, which was required for the Consumer SDK 5.0+ see the [Kotlin 1.9 upgrade\n| guide](/maps/documentation/transportation-logistics/on-demand-rides-deliveries-solution/trip-order-progress/migrations/android_consumer_sdk_v2.0_migration#kotlin_16_to_19_migration).\n\nGradle and AGP compatibility\n\nKotlin 2.0 has [requirements for the minimum and maximum\nversions](https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin)\nfor your Gradle and Android Gradle Plugin (AGP) version. Ensure that your\nproject meets these requirements for Kotlin 2.0.\n\nAGP minimum version for the Consumer SDK 3.0+\n\nConsumer SDK 3.0 requires using AGP 7.3+.\n\nFull R8 mode\n\nConsumer SDK v3 and below does not support Full R8 mode. You must explicitly\ndisable Full R8 mode if your application targets AGP 8.0+. \n\n # settings.gradle\n android.enableR8.fullMode=false\n\nKotlin version compatibility\n\nKotlin supports backwards compatibility with [three previous language\nversions](https://kotlinlang.org/docs/kotlin-evolution-principles.html#compatibility-options).\nThis means that if you are already using Kotlin 1.7+ with the Consumer SDK, you\nshould be able to upgrade to Kotlin 2.0 without having to resolve all of the\nbreaking changes. However, [Kotlin compatibility only applies to stable language\nfeatures](https://kotlinlang.org/docs/components-stability.html#stability-levels-explained).\nIf you are using alpha, beta or experimental features in the Kotlin language,\nthen you may have to make additional changes when upgrading.\n\nKotlin compatibility flags\n\nAs noted in the previous section, Kotlin supports up to 3 previous versions of\nthe language when upgrading. Kotlin [supplies two flags to help with limiting\nbreaking changes](https://kotlinlang.org/docs/compatibility-modes.html):\n\nlanguage-version X.Y\n\nThis flag reverts breaking changes to the behavior of a previous Kotlin version.\nFor example, if you are using Kotlin 1.7, you could specify `[ -\nlanguage-version 1.7]` and the new breaking changes would no longer take effect: \n\n android {\n kotlinOptions {\n languageVersion = '1.7'\n }\n }\n\napi-version X.Y\n\nThis flag prevents new APIs from being used before dependent downstream code is\nready to incorporate Kotlin 2.0. \n\n android {\n kotlinOptions {\n apiVersion = '1.7'\n }\n }\n\nA more targeted approach\n\nIn addition to using Kotlin compatibility flags, we recommend reviewing the\nKotlin release notes and choosing the behaviors that you would like to retain\nfrom the version that you are upgrading from. Kotlin provides a list of breaking\nchanges and the flags that can be set to retain the original behavior in its\ncompatibility guides for each version:\n\n- [1.8 compatibility guide](https://kotlinlang.org/docs/compatibility-guide-18.html)\n- [1.9 compatibility guide](https://kotlinlang.org/docs/compatibility-guide-19.html)\n- [2.0 compatibility guide](https://kotlinlang.org/docs/compatibility-guide-20.html)"]]