오류 내용 :
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.
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.
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.