Attempt to invoke virtual method 'void com.example.socket.services.SocketIOService.emit
Opened this issue · 2 comments
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.socket.services.SocketIOService.emit(java.lang.String, java.lang.Object[])' on a null object reference
at com.example.socket.socketiochat.AppSocketListener.emit(AppSocketListener.java:134)
at com.example.socket.activities.MainTabbedActivity.onCreate(MainTabbedActivity.java:44)
i am getting this error when i am logged in or signup to the application.
This app is supposed to run with the following server:
https://github.com/Mika412/node.js-socket.io-firebase-chatserver
If you don't have it running or have it miss-configured, then it can be the reason for it giving you this error. Clearly I forgot to add a catch for this error.
Additionally, I haven't touched this project for the last 4 years, meaning that since then the way Firebase works may have changed.
on database client you have added this as url const val CHAT_SERVER_URL = "http://192.168.1.71:3000" //Chat server ip and port