Android Firebase - cant get userid using getUid() - Error: on null object reference

后端 未结 5 809
南笙
南笙 2021-01-02 06:23

I am using Firebase and have a signup / login activities working fine but I also want each user to update a username. It seems I am unable to run:

firebaseR         


        
5条回答
  •  -上瘾入骨i
    2021-01-02 07:14

    FirebaseAuth.getInstance().getUid(); This API seems to have been removed in Firebase 12.0.0

    Use this instead FirebaseAuth.getInstance().getCurrentUser().getUid();

    with the appropriate null check, or use Firebase 12.0.1 where i now seems to have @Hide annotation

提交回复
热议问题