java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.kakao.usermgmt.response.model.UserAccount.getEmail()' on a null object reference
at com.josephnk.flutterkakaologin.FlutterKakaoLoginPlugin$SessionCallback$1.onSuccess(FlutterKakaoLoginPlugin.java:240)
at com.josephnk.flutterkakaologin.FlutterKakaoLoginPlugin$SessionCallback$1.onSuccess(FlutterKakaoLoginPlugin.java:220)
at com.kakao.network.callback.ResponseCallback.onSuccessForUiThread(ResponseCallback.java:76)
at com.kakao.network.tasks.KakaoResultTask$1$1.run(KakaoResultTask.java:78)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:209)
at android.app.ActivityThread.main(ActivityThread.java:7021)
E/AndroidRuntime(18898): at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:486)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:872)
@JosephNK
이메일 사용 설정을 안했을때 다음과 같이 에러가 여전히 발생 합니다.
java final String userEmail = (resultKakao.getKakaoAccount().getEmail() == null) ? "" : resultKakao.getKakaoAccount().getEmail();
getKakaoAccount() 가 null 이라 에러가 발생합니다.
이해를 돕기 위해 로그켓 내용도 같이 첨부합니다.
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.kakao.usermgmt.response.model.UserAccount.getEmail()' on a null object reference at com.josephnk.flutterkakaologin.FlutterKakaoLoginPlugin$SessionCallback$1.onSuccess(FlutterKakaoLoginPlugin.java:240) at com.josephnk.flutterkakaologin.FlutterKakaoLoginPlugin$SessionCallback$1.onSuccess(FlutterKakaoLoginPlugin.java:220) at com.kakao.network.callback.ResponseCallback.onSuccessForUiThread(ResponseCallback.java:76) at com.kakao.network.tasks.KakaoResultTask$1$1.run(KakaoResultTask.java:78) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:209) at android.app.ActivityThread.main(ActivityThread.java:7021)
E/AndroidRuntime(18898): at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:486) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:872)
_Originally posted by @GwonHyeok in https://github.com/JosephNK/flutter_kakao_login/issues/7#issuecomment-484192576_