crossplatformkorea / react-native-kakao-login

react-native native module for Kakao sign in.
MIT License
352 stars 134 forks source link

[Android] at com.kakao.auth.Session.getCurrentSession (Session.java:112) #145

Closed ringle-admin closed 3 years ago

ringle-admin commented 4 years ago

앱이 처음 켜지고 로그인 하고 하는 것들은 문제가 없으나, 일정시간이 지나고 나서 앱이 갑자기 크래시가 나는 경우가 다 수 발생하였습니다.

아래 에러 레포트는 구글 플레이 콘솔에 있는 것을 붙여넣었습니다. 감사합니다.

Version of kakao-login libraries

2.4.5

Version of react-native

0.62.2

Platforms you faced the error (IOS or Android or both?)

Android

Expected behavior

앱의 정상 동작

Actual behavior

프로덕션 상의 앱이 간혹 크레시 됨.

Tested environment (Emulator? Real Device?)

Galaxy A90 5G(r3q) Galaxy Note10 5G(d1x) 기타 등등

error code

java.lang.RuntimeException: 
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4644)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4677)
  at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2270)
  at android.os.Handler.dispatchMessage (Handler.java:107)
  at android.os.Looper.loop (Looper.java:237)
  at android.app.ActivityThread.main (ActivityThread.java:8125)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:496)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1100)
Caused by: java.lang.IllegalStateException: 
  at com.kakao.auth.Session.getCurrentSession (Session.java:112)
  at com.kakao.auth.KakaoSDK$1.onActivityResumed (KakaoSDK.java:69)
  at android.app.Application.dispatchActivityResumed (Application.java:455)
  at android.app.Activity.dispatchActivityResumed (Activity.java:1291)
  at android.app.Activity.onResume (Activity.java:1819)
  at androidx.fragment.app.FragmentActivity.onResume (FragmentActivity.java:455)
  at com.facebook.react.ReactActivity.onResume (ReactActivity.java:56)
  at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1454)
  at android.app.Activity.performResume (Activity.java:8105)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4634)
heyman333 commented 4 years ago

91 한번 참고해보시고 적용해보실래요?

danmaas commented 3 years ago

I fixed this by moving KakaoSDK.init() out of the RNKakaoLoginsModule() constructor and only calling it just before login(). Most other React Native modules do not do any important work in the constructor; I suspect there might be an initialization order problem if you put KakaoSDK.init() there.

heyman333 commented 3 years ago

closed in favor of #157