Android 에서 카카오 로그인 연동 시 하기와 같이 에러 발생하면서 로그인이 불가능한 상태가 발생한다.
2021-09-23 11:00:36.327 4851-4851/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: kr.co.test, PID: 4851
java.lang.RuntimeException: Unable to create application kr.co.test.utils.GlobalApplication: java.lang.NullPointerException: Argument 'cacheName' cannot be null
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7540)
at android.app.ActivityThread.access$1500(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2158)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8595)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: java.lang.NullPointerException: Argument 'cacheName' cannot be null
at com.kakao.util.helper.Utility.notNull(Utility.java:97)
at com.kakao.util.helper.SharedPreferencesCache.<init>(SharedPreferencesCache.java:82)
at com.kakao.auth.Session.<init>(Session.java:145)
at com.kakao.auth.Session.initialize(Session.java:101)
at com.kakao.auth.KakaoSDK.init(KakaoSDK.java:101)
at kr.co.test.utils.GlobalApplication.onCreate(GlobalApplication.java:30)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7535)
at android.app.ActivityThread.access$1500(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2158)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8595)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
해당 현상은 AppKey가 등록이 안되서 발생하는 것입니다.
AndroidManifest.xml 에 하기와 같이 네이티브 앱키 등록
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<uses-permission android:name="android.permission.INTERNET" />
<application
...
<meta-data android:name="com.kakao.sdk.AppKey" android:value="8986a97c6664ef9f2c..."/>
</application>
</manifest>
'Mobile > Android' 카테고리의 다른 글
[Android] Android WebView 디버깅 (0) | 2021.09.28 |
---|---|
[ Android ] a webview method was called on thread 'javabridge' 에러가 발생했을 때 (0) | 2021.09.16 |
[Android] 로컬 웹뷰 ajax cross origin 에러 (0) | 2020.12.05 |
[Android] WebView에서 JavaScript 스레드 오류 (0) | 2020.12.05 |
[Android] Android 에서 기본으로 제공하는 이미지 (0) | 2019.01.22 |