1. Installation Environment

2. SDK Environment Setup

2.1. build.gradle(project level)

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        // Requires at least version 3.1.2
        classpath 'com.google.gms:google-services:4.3.3'
    }
}
  
allprojects {
    repositories {
        google()
        mavenCentral()
        
        maven {
            url 'https://devrepo.kakao.com/nexus/content/groups/public/'
            name 'kakao'
        }
        maven {
            url 'https://s3.ap-northeast-2.amazonaws.com/kakao-sdk-release/release/'
            name 'Kakaogames'
        }
    }
}

2.2. gradle.properties

# Project-wide Gradle settings.
org.gradle.jvmargs=-Xmx4608M
KAKAO_GAME_SDK_VERSION=4.0.0
  
# Add the following two settings
android.useAndroidX=true
android.enableJetifier=true

2.3. build.gradle(app level)

In the build.gradle file of the applied application, selectively configure the necessary modules as shown below.

apply plugin: 'com.android.application'
 
android {
    ...
  
    // Required to use Java 8 language features
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
...
  
dependencies {
    // Required for games using guest authentication.
    implementation "com.kakaogame.publishing:idp_device:$KAKAO_GAME_SDK_VERSION"
 
    // Required for games using Kakao authentication.
    implementation "com.kakaogame.publishing:idp_kakao:$KAKAO_GAME_SDK_VERSION"
 
    // Required for games using Apple authentication.
    implementation "com.kakaogame.publishing:idp_siwa:$KAKAO_GAME_SDK_VERSION"
 
    // Required to use the main features of the Game SDK.
    implementation "com.kakaogame.publishing:gamesdk:$KAKAO_GAME_SDK_VERSION"
}
  
apply plugin: 'com.google.gms.google-services'  // Google Services plugin

2.4. External Library Dependencies

The necessary libraries are set as dependencies with the versions listed below. These are automatically included when connecting to the Kakao Game SDK.

SDK version

Module

External Libraries

4.0.1

gamesdk

com.google.android.gms:play-services-ads-identifier:18.0.0
androidx.appcompat:appcompat:1.3.1
androidx.legacy:legacy-support-v4:1.0.0
androidx.core:core-ktx:1.6.0
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0
androidx.databinding:viewbinding:7.0.4
com.google.android.play:review:2.0.0
com.google.android.play:app-update:2.0.0
com.android.installreferrer:installreferrer:2.2
com.github.bumptech.glide:glide:4.10.0
androidx.cardview:cardview:1.0.0

idp_kakao

com.kakao.sdk:{module}:2.13.0

idp_facebook

com.facebook.android:facebook-android-sdk:14.1.1

idp_googlegame

com.google.android.gms:play-services-auth:20.6.0
com.google.android.gms:play-services-games-v2:17.0.0
androidx.annotation:annotation:1.0.0

security

com.google.android.material:material:1.6.1

payment

com.android.billingclient:billing:6.0.1
androidx.recyclerview:recyclerview:1.0.0

4.4.0

gamesdk

com.google.android.gms:play-services-ads-identifier:18.0.0
androidx.appcompat:appcompat:1.6.1
androidx.legacy:legacy-support-v4:1.0.0
androidx.core:core-ktx:1.10.0
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0
androidx.databinding:viewbinding:7.0.4
com.google.android.play:review:2.0.0
com.google.android.play:review-ktx:2.0.0
com.google.android.play:app-update:2.0.0
com.google.android.play:app-update-ktx:2.0.0
com.android.installreferrer:installreferrer:2.2
com.github.bumptech.glide:glide:4.10.0
androidx.cardview:cardview:1.0.0

idp_kakao

com.kakao.sdk:{module}:2.18.0

idp_facebook

com.facebook.android:facebook-android-sdk:14.1.1

idp_googlegame

com.google.android.gms:play-services-auth:20.6.0
com.google.android.gms:play-services-games-v2:17.0.0
androidx.annotation:annotation:1.0.0

security

com.google.android.material:material:1.6.1

payment

com.android.billingclient:billing:6.0.1
androidx.recyclerview:recyclerview:1.0.0

firebase

com.google.firebase:firebase-bom:32.8.1
com.google.firebase:firebase-analytics
com.google.firebase:firebase-perf
com.google.firebase:firebase-crashlytics
com.google.firebase:firebase-messaging

 If the game uses external libraries that overlap with the above libraries and dependencies, you can remove the conflicting links as shown below and use the higher version.

build.gradle(app level)

dependencies {
    ...
     implementation ('com.kakaogame:gamesdk:{KAKAO_SDK_VERSION}') {
        exclude group: 'com.google.android.gms', module: 'play-services-ads' // The library you want to remove
        exclude group: 'com.android.support' // You can also remove the entire group of libraries. This can be adjusted if there is a build error due to version mismatches in support libraries.
        ...
    }
}

 Below is an example of changing the Facebook SDK version to the desired version in the game.

build.gradle(app level)

dependencies {
    ...
    implementation ('com.kakaogame:idp_facebook:{KAKAO_SDK_VERSION}') {
        exclude group: 'com.facebook.android', module: 'facebook-android-sdk'
    }
  
    implementation 'com.facebook.android:facebook-android-sdk:4.39.0'
}

If your development team does not use Crashlytics, you can remove it as shown below.

build.gradle(app level)

dependencies {
    ...
    implementation ("com.kakaogame:firebase:$KAKAO_GAME_SDK_VERSION") {
        exclude group: 'com.crashlytics.sdk.android', module: 'crashlytics'
    }
}

3. IDP Authentication Information Setup

3.1. Kakao Authentication Information Setup

Add the following resource file and set the values in src/main/res/values/kakao_game_kakao_auth.xml.

The value for "Kakao App Key" needs to be replaced with the issued key.

res/values/kakao_game_kakao_auth.xml

<?xml version="1.0" encoding="UTF-8"?>
 
<resources>
    <string name="kakao_app_key">[Kakao App Key]</string>
    <string name="kakao_scheme">kakao[Kakao App Key]</string>
    <string name="kakaotalk_host">kakaotalk</string>
    <string name="kakaolink_host">kakaolink</string>
    <string name="kakaostory_host">kakaostory</string>
</resources>

3.2. SigninWithApple Authentication Information Setup

Add the following resource file and set the values in src/main/res/values/kakao_game_siwa_auth.xml.

The value for "SIWA Client ID" needs to be replaced with the issued key from Apple.

res/values/kakao_game_siwa_auth.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="siwa_client_id">[SIWA Client ID]</string>
</resources>

4. AndroidManifest.xml File Configuration

The AndroidManifest.xml file of the game app must be configured with the following settings.

4.1. Common Settings

AndroidManifest.xml (Common Settings)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- KakaoGame SDK START -->
<uses-sdk
    android:minSdkVersion="23"
    android:targetSdkVersion="31" />
<!-- KakaoGame SDK END -->
 
<!-- KakaoGame SDK START -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- KakaoGame SDK END -->
 
<application
    android:usesCleartextTraffic="true"
    android:resizeableActivity="true">
    <!-- MainActivity START : Included only in the publishing guide: Start -->
    <activity android:name="com.companyname.MainActivity"
          android:configChanges="orientation|screenSize|keyboard|screenLayout|screenSize|smallestScreenSize"
          android:label="@string/app_name"
          android:launchMode="singleTask"
          android:screenOrientation="sensor"
          android:exported=”true” >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="kakaogame[App Id]" />
    </intent-filter>
    ...
    </activity>
    <!-- MainActivity END : Included only in the publishing guide: End -->
</application>
</manifest>

4.2. Kakao Authentication Configuration

AndroidManifest.xml (Kakao Authentication Configuration)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
<application>
    <activity android:name=".MainActivity"
              android:exported=”true”>
        <!-- Kakao Auth START -->
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/kakao_scheme" android:host="@string/kakaolink_host" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/kakao_scheme" android:host="@string/kakaostory_host" />
        </intent-filter>
        <!-- Kakao Auth END -->
    </activity>
 
    <activity android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
              android:exported=”true”>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:host="oauth" android:scheme="@string/kakao_scheme" />
        </intent-filter>
    </activity>
</application>
</manifest>

4.3. HTTP Usage Configuration

If targetSdkVersion is set to version 28 or higher and the game uses HTTP communication, the following configuration is necessary.

The Kakao Game SDK does not use HTTP internally. This setting is only needed if the developer requires HTTP calls for issues like CDN.

4.4. Game Supported Language Resources

If there are additional language packs in the library that are not supported by the game, and you want to remove them, you can delete the corresponding folder at the location below.

For example, if you want to remove the Japanese language settings, delete the KakaoGameSDK>res>values-ja folder.

5. Key Hash Verification and Registration Method

5.1. Obtaining the Debug Key Hash

[debug_keystore_path]

5.2. Obtaining the Release Key Hash

keytool -exportcert -alias [release_key_alias] -keystore [release_keystore_path] | openssl sha1 -binary | openssl base64

6. Build Verification

Verify that the project builds successfully.