majlindavdylaj / ChatAppTutorial

https://www.youtube.com/koddev
127 stars 97 forks source link

Application crash after loggining in #7

Open mblazejczyk opened 5 years ago

mblazejczyk commented 5 years ago

App works till I login. Then everything crash I set up database correctly (I think) but it still crash https://imgur.com/a/vI4ngYN also, when I register it create users and tokens (just first user does not get token, just "online") every other user work fine. https://imgur.com/a/LlS94PL

mblazejczyk commented 5 years ago

-it was my bad, database was somehow broken and I removed invalid user and now it works perfectly fine.-

pawanshaw12 commented 5 years ago

I have the same problem ,I set the permission to true in realtime datbase after that the app is crashing after login in .Can you please help?

ahmedabdel2leem commented 5 years ago

dont use this classpath 'com.google.gms:google-services:4.1.0' its seems like theres something wrong in this version u could use 4.2.0 wish u all the luck

FlavianBulancea commented 5 years ago

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference at com.koddev.chatapp.Fragments.UsersFragment$3.onDataChange(UsersFragment.java:124) after I login or register Any suggestion?

mbahgojol commented 5 years ago

add the code below if (String.valueOf(snapshot.getKey()).matches("-(.*)")) {

like this

for (DataSnapshot snapshot : dataSnapshot.getChildren()) { if (String.valueOf(snapshot.getKey()).matches("-(.*)")) { Chat chat = snapshot.getValue(Chat.class);