Google 로그인 API가 지원 중단됨에 따라 2026년에 게임 v1 SDK가 삭제됩니다. 2025년 2월 이후에는 게임 v1 SDK와 새로 통합된 타이틀을 Google Play에 게시할 수 없습니다. 대신 games v2 SDK를 사용하는 것이 좋습니다.
이전 게임 v1 통합이 적용된 기존 타이틀은 몇 년 동안 계속 작동하지만 2025년 6월부터는 v2로 이전하는 것이 좋습니다.
이 가이드는 Play 게임즈 서비스 v1 SDK 사용에 관한 가이드입니다. Play 게임즈 서비스 v2용 C++ SDK는 아직 사용할 수 없습니다.
이 개발자 가이드에서는 Google Play 게임즈 서비스 API를 사용하는 Android에서 C++ 게임을 컴파일하고 실행하는 방법을 보여줍니다. 시작하기 전에 다음 요구사항을 다운로드하여 구성합니다.
MinimalistActivity 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 Properties를 클릭합니다. Android에서 라이브러리 섹션으로 아래로 스크롤하여 google-play-services_lib 프로젝트가 올바르게 참조되는지 확인합니다. 그렇지 않으면 참조를 삭제하고 워크스페이스에서 다시 추가합니다.
Eclipse는 프로젝트의 Java 및 Android 소스를 자동으로 컴파일하지만 jni 폴더의 네이티브 코드는 별도로 컴파일해야 합니다. 수동으로 하려면 jni 폴더로 이동하여 ndk-build를 실행합니다. jni 폴더 내에서 변경한 후에는 이 작업을 실행해야 합니다.
이제 프로젝트가 컴파일되지만 아직 작동하지는 않습니다. 먼저 Google Play Console에서 게임을 구성해야 합니다.
2단계: Google Play Console에서 게임 설정하기
Google Play Console에서 게임의 항목을 생성합니다. 그러면 애플리케이션에서 게임 서비스가 활성화되고 OAuth 2.0 클라이언트 ID가 아직 없는 경우 새로 생성됩니다.
AndroidManifest.xml에서 <manifest> 태그의 package 속성을 Google Play Console을 설정할 때 선택한 패키지 이름으로 변경합니다. 이 변경사항을 적용한 후 프로젝트 전체에서 일부 참조 (특히 생성된 R 클래스)를 수정해야 할 수 있습니다.
res/values/ids.xml를 열고 앱 ID를 입력합니다. 앱 ID는 클라이언트 ID와 다릅니다. 앱 ID는 Google Play Console의 게임 세부정보 페이지에 있는 게임 이름 옆에 있는 숫자입니다.
3단계: 샘플 실행
샘플을 실행하려면 실제 Android 기기 또는 Google Play 서비스가 설치된 에뮬레이터가 필요합니다.
ndk-build를 실행하여 네이티브 코드를 컴파일합니다.
Eclipse에서 Run > Run As > Android Application을 클릭하고 기기에서 샘플을 실행합니다.
샘플이 열리면 화면의 아무 곳이나 탭합니다. Google Play 게임즈 로고가 표시됩니다. 앱이 올바르게 구성되면 로그인하라는 메시지가 표시됩니다.
선택사항: Eclipse로 자동 빌드
다음 단계에서는 jni 폴더의 파일을 변경할 때 ndk-build를 자동으로 실행하도록 Eclipse를 구성하는 방법을 보여줍니다.
MinimalistActivity 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 Properties를 클릭합니다. 속성 창에서 빌더 창을 선택합니다.
새로 만들기를 클릭하여 새 빌더를 추가하고 프로그램을 선택한 다음 확인을 클릭합니다.
이름 필드에 'NDK 빌더'를 입력합니다.
위치에서 파일 시스템 찾아보기를 클릭하고 NDK_ROOT 디렉터리로 이동하여 ndk-build 명령어를 선택합니다.
작업 디렉터리에서 작업공간 둘러보기를 클릭하고 MinimalistActivity 프로젝트 폴더를 선택합니다.
새로고침 탭을 클릭합니다. 완료 시 리소스 새로고침 체크박스가 선택되어 있는지 확인합니다.
특정 리소스 라디오 버튼을 선택한 다음 리소스 지정을 클릭합니다. 표시되는 대화상자에서 MinimalActivity 아래의 jni 폴더를 선택합니다.
Apply(적용)를 클릭한 다음 OK(확인)를 클릭하여 빌더 만들기를 완료합니다.
이제 jni 폴더 내에서 파일을 수정할 때마다 Eclipse에서 ndk-build를 실행하고 출력을 Eclipse Console에 출력합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Get Started with Play Games Services for C++ on Android\n\nFollowing the deprecation of the\n[Google Sign-In](https://android-developers.googleblog.com/2024/09/streamlining-android-authentication-credential-manager-replaces-legacy-apis.html)\nAPI, we are removing the games v1 SDK in 2026. After February 2025, you will be unable to publish\ntitles that are newly integrated with games v1 SDK, on Google Play. We recommend that you use the\ngames v2 SDK instead. \n\nWhile existing titles with the previous games v1 integrations continue to function for a\ncouple of years, you are encouraged to\n[migrate to v2](/games/pgs/android/migrate-to-v2)\nstarting June 2025. \n\nThis guide is for using the Play Games Services v1 SDK. The C++ SDK for\nPlay Games Services v2 is not yet available.\n\nThis developer guide will show you how to compile and run a C++ game on Android that uses the Google Play\nGame services API. Before you begin, download and configure the following requirements:\n\n- [Android NDK](/ndk), Revision 14 or higher.\n- [Android SDK v10 or higher and latest version of the Eclipse ADT](/studio/tools/sdk/eclipse-adt).\n- Device must be running Android 4.0 (API level 14) or higher.\n- [The latest version of the Google Play services SDK.](https://developers.google.com/android/guides/setup)\n\nThis developer guide uses the Android Native Development Kit (NDK). If you are unfamiliar with the NDK,\nrefer to the [NDK documentation and samples](/ndk)\nbefore continuing.\n\nStep 1: Set up your environment\n-------------------------------\n\n1. Download the Android SDK and the Android NDK and extract them to your machine. In your environment, set `SDK_ROOT` to the location of your Android SDK folder and `NDK_ROOT` to the location of your Android NDK folder.\n2. Download the [C++ sample games](//github.com/playgameservices/cpp-android-basic-samples). This developer guide refers to the location of the samples on your machine as `SAMPLES_DIR`.\n3. Download the [Google Play Games services C++ SDK](/games/pgs/downloads#sdk). Extract the SDK onto your development machine. In your environment, set the variable `NDK_MODULE_PATH` to point to the directory **above** the `gpg-cpp-sdk` directory. You should have the following directory structure: \n\n ```\n NDK_MODULE_PATH/\n gpg-cpp-sdk/\n ```\n4. Open Eclipse. If you have not already done so, tell Eclipse where you installed the NDK by clicking **Preferences \\\u003e Android \\\u003e NDK**.\n5. Import the Google Play services library project into your Eclipse workspace.\n\n 1. In Eclipse, click **File \\\u003e Import \\\u003e Android \\\u003e Existing Android Code into Workspace**.\n 2. Select `SDK_ROOT/extras/google/google_play_services/libproject/google-play-services_lib` where `SDK_ROOT` is the location of your Android SDK.\n 3. Click **Finish**.\n6. Import the minimalist sample project into your Eclipse workspace.\n\n 1. In Eclipse, click **File \\\u003e Import \\\u003e Android \\\u003e Existing Android Code into Workspace**.\n 2. Select `SAMPLES_DIR/samples-android/minimalist`.\n 3. Click **Finish**.\n7. Right click the MinimalistActivity project and click **Properties** . Under **Android** , scroll\n down to the **Library** section and make sure the google-play-services_lib project is correctly\n referenced. If not, remove the reference and add it again from your workspace.\n\nEclipse will automatically compile the Java and Android sources of your project; however, the\nnative code in the `jni` folder needs to be compiled separately. To do this manually, navigate to\nthe `jni` folder and run `ndk-build`. Remember to do this after you make any changes inside\nthe `jni` folder.\n\nYour project should now compile, though it will not work yet. You must first configure your game\nin the Google Play Console.\n\nStep 2: Set up the game in the Google Play Console\n--------------------------------------------------\n\nCreate an entry for your game in the Google Play Console. This enables Games services for your\napplication, and creates an OAuth 2.0 client ID, if you don't already have one.\n\n1. Create an entry for your game by following the steps described in [Setting Up Google Play Games Services](/games/pgs/console/setup).\n2. In `AndroidManifest.xml`, change the `package` attribute of the `\u003cmanifest\u003e` tag to the package name you chose when setting up the Google Play Console. You may have to fix some references throughout the project after making this change (particularly to the generated `R` class).\n3. Open `res/values/ids.xml` and place your App ID there. Note that the App ID is not the same as the client ID; it is the number next to the name of your game in the **Game Details** page of the Google Play Console.\n\nStep 3: Run the sample\n----------------------\n\nIn order to run the sample you will need a physical Android device or an emulator with\nGoogle Play services installed:\n\n1. Run `ndk-build` to compile the native code.\n2. In Eclipse, click **Run \\\u003e Run As \\\u003e Android Application** and run the sample on your device.\n3. When the sample opens, tap anywhere on the screen. You should see a Google Play Games logo appear. If you have correctly configured your app, you will be prompted to sign in.\n\n| **Important:** Make sure to sign your APK with the same certificate as the one whose fingerprint you configured on Google Play Console. Failure to do so will produce errors.\n| **Important:** If you are testing an unpublished game, make sure that the account with which you intend to sign in (usually, the account on the test device) is listed as a tester in the project. Open the **Testing** page, in the **Game services** subtab of the Google Play Console, to check or perform whitelisting. Failure to perform this step causes the server to act as though your project does not exist, and return errors.\n\nOptional: Build automatically with Eclipse\n------------------------------------------\n\nThe following steps show you how to configure Eclipse to automatically run `ndk-build` when you\nmake changes to files in the `jni` folder.\n\n1. Right-click the MinimalistActivity project and click **Properties** . In the Properties window, select the **Builders** pane.\n2. Click **New** to add a new Builder and select **Program** then click **OK**.\n3. In the **Name** field, enter 'NDK Builder'.\n4. Under **Location** click **Browse File System** and navigate to the `NDK_ROOT` directory and select the `ndk-build` command.\n5. Under **Working Directory** click **Browse Workspace** and select the MinimalistActivity project folder.\n6. Click the **Refresh** tab. Make sure the **Refresh resources upon completion** box is checked.\n7. Select the **Specific resources** radio button and then click **Specify Resources** . In the resulting dialog, select the `jni` folder under MinimalActivity.\n8. Click **Apply** and then **OK** to finish creating your Builder.\n\nNow every time you edit a file within the `jni` folder, Eclipse will run `ndk-build` and print the\noutput to the Eclipse Console.\n| **Note:** If you see errors when editing C or C++ files in Eclipse that prevent you from building the project, you may want to disable C/C++ error reporting in Eclipse. In your project properties, navigate to **C/C++ General \\\u003e Code Analysis \\\u003e Launching** and make sure that both boxes are unchecked. Then click **Apply** and **OK** . This is a workaround to prevent Eclipse from checking your native code, it does **not** fix any real underlying errors you may have."]]