카카오싱크 오류 문의드립니다

문의 사항에 따라 필요한 정보를 먼저 입력하시면 더 빠르게 대응해 드릴 수 있습니다.

  • 개발 과정에서 문제가 있을 경우

    • 앱 아이디(app ID) : 619311
    • 호스팅 사:
    • 서비스 URL :
    • 오류 내용 :
      Hi, I got the error from inside kakao: “kotlin.UninitializedPropertyAccessException: lateinit property hosts has not been initialized” is the message it returns. ‘hosts’ is a property in the kakao sdk, and we do call init with our native android key before making these calls, and also it works when building locally, just not with a signed apk using our production keys even though our prod key hash has been added to the kakao key hash section in the developer portal.
      there was a warning which we don’t have exactly but it was indicating that there was no token available or a bad token or something – I didn’t know what it meant and the error is different now but may help?
      Thanks in advance.
  • 퍼머링크 생성이 필요할 경우 (자세한 신청 방법은 가이드 참고)

    • 카카오싱크 퍼머링크의 서비스 랜딩URL:
    • 디벨로퍼스 앱과 연결된 카카오톡 채널의 검색용 아이디:

카카오 로그인 관련 에러(Invalid redirect. 예: KOE006)가 발생할 경우, 가이드를 참고합니다.

hi.

Please write down the code related to KakaoSDK init.
What version of KakaoSDK did you use?

sdk v2 (2.5.2 to be more precise i believe)

Show me your init code.

Hi, thanks for taking a look, here is the code:

implementation "com.kakao.sdk:v2-user:2.5.2"

App.kt
import com.kakao.sdk.common.KakaoSdk
onCreate()
// Initialize Kakao for login
KakaoSdk.init(this, KAKAO_KEY)

Kakao key is copy pasted the native key we have

You wrote it on a GlobalApplication.kt, right?

Android | Kakao Developers Docs

“kotlin.UninitializedPropertyAccessException: lateinit property hosts has not been initialized”

The error occurs when initialization is not properly performed. Please refer to the guide.

App.kt is what we call it, but yep it is the class that inherits from Application()

Double checking the docs it seems like we are following all the steps. Is there any initialization call need other than the call to KakaoSdk.init?

An idea I had is that maybe we are generating the key hash with a method that doesn’t work – we were using the terminal with keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64

But I added in the hash using Utility.getKeyHash(this) as well, which turned out to be different.

I checked out the logs and see we are actually getting this error as well which could be helpful:

	   Process: com.mistplay.mistplay, PID: 20609
	    ClientError(reason=TokenNotFound, msg=Refresh token not found in the response.)
	        at com.kakao.sdk.auth.model.OAuthToken$Companion.fromResponse(SourceFile:12)
	        at com.kakao.sdk.auth.model.OAuthToken$Companion.fromResponse$default(SourceFile:1)
        at com.kakao.sdk.auth.AuthApiManager$issueAccessToken$1.onResponse(SourceFile:3)

Again it is working when building locally, just not the signed apk.

Looking at the log, it seems to be calling well at the moment.
Is the problem solved?

No it is not solved, still getting the clientError from above for the signed apk

If you use Google Play App Signing, you must use the SHA-1 certificate fingerprint obtained on the Google Play Console, not generating a Release key hash on the Terminal. Refer to Play Console Help > Use Play App Signing for more details.

Android | Kakao Developers Docs

I see, I just tried getting the SHA-1 from the console as you say and then used this terminal command to convert it to base-64, which is necessary because otherwise it is too long. echo <SHA-1 or SHA-256> | xxd -r -p |openssl base64, that produced an identical key to one of the other methods. The same approach with the sha-256 key from the console produced a new base-64 key which I added, but that didn’t cause a change in behaviour when trying to log in with a signed apk.

If you send me the two below, I will check.
Send me a message for security. @tim.l

  • Capture the app signature screen on the Google Play Console.
  • SHA-1 certificate fingerprint text shown in the capture.

Sent!