Android ゲーム向け Play ゲームサービスのスタートガイド
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このガイドでは、Play ゲームサービス SDK を使用するように Android Studio プロジェクトを設定する方法について説明します。Play ゲームサービスのログインを設定して Play ゲームサービス機能をゲームに追加するには、まず以下の手順を完了する必要があります。
始める前に
アプリを準備するには、以下のセクションに示す手順を完了します。
アプリの前提条件
アプリのビルドファイルで次の値が使用されていることを確認します。
minSdkVersion
が 19
以上
compileSdkVersion
が 28
以上
Google Play Console でゲームを設定する
Google Play Console では、各ゲーム用に Google Play Games サービスを管理し、ゲームの認可と認証のためのメタデータを構成します。詳細については、Google Play Games サービスのセットアップをご覧ください。
プロジェクト レベルの build.gradle
ファイルで、buildscript
セクションと allprojects
セクションの両方に Google の Maven リポジトリと Maven セントラル リポジトリを含めます。
buildscript {
repositories {
google()
mavenCentral()
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
モジュールの Gradle ビルドファイルに Google Play 開発者サービスの依存関係を追加します。通常、このビルドファイルは
app/build.gradle
です。
dependencies {
implementation "com.google.android.gms:play-services-games-v2:+"
}
上に示した手順を完了したら、ゲームが Play ゲームサービス機能にアクセスできるように、ログインを設定する必要があります。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],[],null,["# Get started with Play Games Services for Android games\n\n| **Note:** This guide is for the Play Games Services v2 SDK. For information on the previous version of this SDK, see the [Play Games Services v1\n| documentation](/games/pgs/v1/android).\n\nThis guide describes how to set up an Android Studio project to use the\nPlay Games Services SDK. You must complete these steps before you\nset up Play Games Services [sign-in](/games/pgs/android/android-signin) and add\nPlay Games Services features to your game.\n\nBefore you begin\n----------------\n\nTo prepare your app, complete the steps in the following sections.\n\n### App prerequisites\n\nMake sure that your app's build file uses the following values:\n\n- A `minSdkVersion` of `19` of higher\n- A `compileSdkVersion` of `28` or higher\n\n### Set up your game in Google Play Console\n\nThe Google Play Console is where you manage Google Play games services for your\ngame, and configure metadata for authorizing and authenticating your game. For\nmore information, see\n[Set Up Google Play Games Services](/games/pgs/console/setup).\n\nConfigure your app\n------------------\n\nIn your project-level `build.gradle` file, include\n[Google's Maven repository](https://maven.google.com/web/index.html)\nand [Maven central repository](https://search.maven.org/artifact)\nin both your `buildscript` and `allprojects` sections: \n\n buildscript {\n repositories {\n google()\n mavenCentral()\n }\n }\n\n allprojects {\n repositories {\n google()\n mavenCentral()\n }\n }\n\nAdd the [Google Play services](https://developers.google.com/android)\ndependency for the Play Games SDK to your\n[module's Gradle build file](/studio/build#module-level), which is commonly\n\n`app/build.gradle`: \n\n dependencies {\n implementation \"com.google.android.gms:play-services-games-v2:+\"\n }\n\nAfter completing these steps you must set up\n[sign-in](/games/pgs/android/android-signin)\nin order for the game to access Play Games Services features."]]