Google Play 서비스 SDK에는 오픈소스 라이브러리가 포함되거나 오픈소스 라이브러리에 종속되는 경우가 있습니다. 오픈소스 라이브러리의 라이선스 요구사항을 준수하려면 개발자는 앱에서 사용하는 오픈소스 라이브러리의 알림을 적절하게 표시해야 합니다.
Google Play 서비스에는 개발자가 앱에 사용된 라이브러리의 오픈소스 소프트웨어 (OSS) 공지를 더 쉽게 표현할 수 있도록 설계된 도구 세트가 포함되어 있습니다. oss-licenses-plugin 및 Google Play 서비스 oss-licenses SDK는 포함된 라이브러리에서 라이선스 약관을 수집합니다(POM 파일에 선언됨). 또한 이러한 약관을 표시하는 데 사용할 수 있는 활동을 만듭니다. 도구에서 라이선스 정보를 찾아 패키징하는 방법을 자세히 알아보세요.
앱이 빌드되면 Gradle 플러그인이 라이선스를 처리하고 앱의 리소스에 추가합니다. 라이선스를 쉽게 표시하려면 다음 코드 스니펫과 같이 앱의 적절한 지점에서 play-services-oss-licenses 라이브러리에서 제공하는 활동을 실행하면 됩니다.
Kotlin
importcom.google.android.gms.oss.licenses.OssLicensesMenuActivity...// When the user selects an option to see the licenses:startActivity(Intent(this,OssLicensesMenuActivity::class.java))
자바
importcom.google.android.gms.oss.licenses.OssLicensesMenuActivity;...// When the user selects an option to see the licenses:startActivity(newIntent(this,OssLicensesMenuActivity.class));
활동이 실행되면 그림 1과 같이 앱에 컴파일된 오픈소스 라이브러리 목록이 표시됩니다. 여기에는 앱에서 사용되는 라이브러리가 포함됩니다. 사용자는 라이브러리 이름을 탭하여 해당 라이브러리의 추가 라이선스 정보를 볼 수 있습니다.
그림 1. 라이선스 메뉴 활동은 앱에서 사용하는 오픈소스 라이브러리의 선택 가능한 목록을 표시합니다.
활동 제목 설정
기본적으로 표시되는 활동의 제목은 '오픈소스 라이선스'입니다. 다음 코드 스니펫과 같이 setActivityTitle()를 호출하여 활동의 제목을 맞춤설정할 수 있습니다.
[[["이해하기 쉬움","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-17(UTC)"],[[["\u003cp\u003eGoogle Play services uses open source libraries, requiring developers to display licenses.\u003c/p\u003e\n"],["\u003cp\u003eA Gradle plugin helps by gathering license information and creating an activity to display them.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers need to add the plugin, the library dependency, and launch the provided activity in their app.\u003c/p\u003e\n"],["\u003cp\u003eThe license activity's title and theme can be customized.\u003c/p\u003e\n"],["\u003cp\u003eThe plugin scans POM dependencies to compile the license list, including those used by Google Play services itself.\u003c/p\u003e\n"]]],["Developers must display notices for open-source libraries used in their apps. Google Play services provides a Gradle plugin to streamline this. To use it, include the Google Maven repository and add the `oss-licenses` plugin in the root-level build file. Apply the plugin in the app-level build file and add the `oss-licenses` library as a dependency. The plugin then processes licenses from POM files and creates an activity via `OssLicensesMenuActivity` to display them. Developers can customize the activity's title and theme. The plugin scans direct and transitive dependencies, including those of Google Play services.\n"],null,["# Include open source notices\n\n\u003cbr /\u003e\n\nGoogle Play services SDKs sometimes include, or depend upon, open source\nlibraries. To comply with the license requirements of open source libraries, you\nas a developer are responsible for appropriately displaying the notices for the\nopen source libraries that your app uses.\n\nGoogle Play services includes a set of tools designed to give developers an\neasier way to express the open source software (OSS) notices of libraries used\nin their apps. The `oss-licenses-plugin` and the Google Play services\noss-licenses SDK collect license terms from included libraries, as declared in\ntheir POM files, and create an\n[activity](https://developer.android.com/guide/components/activities/intro-activities)\nthat can be used to display these terms. Learn more about\n[how the tool finds and packages license information](#how-licenses-are-determined).\n\nAdd the Gradle plugin\n---------------------\n\nIn your `pluginManagement` of your project settings, do the following:\n\n1. Include the [Google Maven repository](https://developer.android.com/studio/build/dependencies#google-maven).\n2. Resolve the `oss-licenses` plugin in the `PluginManagement`.\n\nThe following code snippet shows these steps: \n\n### Kotlin DSL\n\nsettings.gradle.kts \n\n```kotlin\npluginManagement {\n repositories {\n ...\n google()\n }\n resolutionStrategy {\n eachPlugin {\n if (requested.id.id == \"com.google.android.gms.oss-licenses-plugin\") {\n useModule(\"com.google.android.gms:oss-licenses-plugin:0.10.6\")\n }\n }\n }\n}\n```\n\n### Groovy DSL\n\nbuild.gradle \n\n```groovy\npluginManagement {\n repositories {\n ...\n google()\n }\n resolutionStrategy {\n eachPlugin {\n if (requested.id.id == \"com.google.android.gms.oss-licenses-plugin\") {\n useModule(\"com.google.android.gms:oss-licenses-plugin:0.10.6\")\n }\n }\n }\n}\n```\n\nIn your app-level build file, apply the plugin by adding the following line\nunder the existing declaration of the `com.android.application` plugin at the\ntop of the file: \n\n### Kotlin DSL\n\napp/build.gradle.kts \n\n```kotlin\nplugins {\n id(\"com.android.application\")\n id(\"com.google.android.gms.oss-licenses-plugin\")\n}\n```\n\n### Groovy DSL\n\napp/build.gradle \n\n```groovy\nplugins {\n id 'com.android.application'\n id 'com.google.android.gms.oss-licenses-plugin'\n}\n```\n\nYou can\n[view the code](https://github.com/google/play-services-plugins)\nfor this plugin on GitHub.\n\nAdd the `play-services-oss-licenses` library to your app\n--------------------------------------------------------\n\nIn the `dependencies` section of your app-level build file, add a dependency on\nthe `play-services-oss-licenses` library: \n\n### Kotlin DSL\n\nbuild.gradle.kts \n\n```kotlin\nimplementation(\"com.google.android.gms:play-services-oss-licenses:17.2.2\")\n```\n\n### Groovy DSL\n\nbuild.gradle \n\n```groovy\nimplementation 'com.google.android.gms:play-services-oss-licenses:17.2.2'\n```\n\nDisplay license information\n---------------------------\n\nWhen your app builds, the Gradle plugin processes the licenses and adds them to\nyour app's resources. To easily display the license, you can launch an activity\nthat's provided by the `play-services-oss-licenses` library at an appropriate\npoint in your app, as shown in the following code snippet: \n\n### Kotlin\n\n```kotlin\nimport com.google.android.gms.oss.licenses.OssLicensesMenuActivity\n...\n\n// When the user selects an option to see the licenses:\nstartActivity(Intent(this, OssLicensesMenuActivity::class.java))\n```\n\n### Java\n\n```java\nimport com.google.android.gms.oss.licenses.OssLicensesMenuActivity;\n...\n\n// When the user selects an option to see the licenses:\nstartActivity(new Intent(this, OssLicensesMenuActivity.class));\n```\n\nWhen the activity is launched, it displays a list of open source libraries that\nare compiled into your app, including libraries used by the app, as shown in\nfigure 1. Users can tap on the name of a library to view additional license\ninformation for that library.\n\n**Figure 1.** The licenses menu activity shows a selectable list of open source\nlibraries that an app uses.\n\n### Set the activity title\n\nBy default, the displayed activity has the title \"Open source licenses\". You can\ncustomize the title of the activity by calling\n[`setActivityTitle()`](/android/reference/com/google/android/gms/oss/licenses/OssLicensesMenuActivity#public-static-void-setactivitytitle-string-title),\nas shown in the following code snippet: \n\n### Kotlin\n\n```kotlin\nOssLicensesMenuActivity.setActivityTitle(getString(R.string.custom_license_title))\n```\n\n### Java\n\n```java\nOssLicensesMenuActivity.setActivityTitle(getString(R.string.custom_license_title));\n```\n\n### Apply a theme to the activity\n\nYou can apply a theme to the activity to match the theme used in your app's\nother activities. To do so, include the open source license activity in an\n`\u003cactivity\u003e` element within your app's manifest file, as shown in the following\ncode snippet: \n\n```xml\n\u003capplication android:theme=\"@style/AppTheme\" ...\u003e\n \u003cactivity\n android:name=\"com.google.android.gms.oss.licenses.OssLicensesMenuActivity\"\n android:theme=\"@style/AppTheme\" /\u003e\n \u003cactivity\n android:name=\"com.google.android.gms.oss.licenses.OssLicensesActivity\"\n android:theme=\"@style/AppTheme\" /\u003e\n\u003c/application\u003e\n```\n\nHow the list of licenses is determined\n--------------------------------------\n\nAt compile time, the Gradle plugin scans the POM dependencies of your app's\nproject. When a Maven POM exists for a direct dependency of the app, the plugin\nprocesses each [`\u003clicenses\u003e`](https://maven.apache.org/pom.html#Licenses)\nelement and embeds the link and title of each license in an Android asset that's\nincluded with your app.\n| **Note:** The list of licenses also includes the full license text of any library that is depended upon by the transitive closure of Google Play services libraries used by the app. This means that the list includes any open source libraries that are used to create the Google Play services libraries that are compiled into your app."]]