ConnectyCube / android-messenger-app

Chat and voice / video calling app using ConnectyCube
https://connectycube.com
Apache License 2.0
51 stars 23 forks source link

App open and login succesfully and then close itself #31

Closed AnnBenavides closed 4 years ago

AnnBenavides commented 4 years ago

Hello, I'm tryng to work with this source code, and followed the steps on the readme. Then followed the steps for Firebase integration succesfully, but when I run the application is launched to the login screen, select a user and then it throws this before it closes.

D/CB-SDK: *********************************************************
    *** RESPONSE *** aaff1dc2-06b6-4dc6-99ec-3bc852aa2ccb ***
    STATUS : 200 
    HEADERS
        Status=200 OK
        Transfer-Encoding=chunked
        Server=nginx/1.12.1
        Access-Control-Allow-Origin=*
        X-Request-Id=a09602bc-43a7-46bb-8537-563fed2e4e65
        CB-Token-ExpirationDate=2019-10-01 20:32:17 UTC
        X-Content-Type-Options=nosniff
        X-Runtime=0.021784
        Connection=close
        X-Android-Received-Millis=1569954745598
        Date=Tue, 01 Oct 2019 18:32:26 GMT
        X-Frame-Options=SAMEORIGIN
        ConnectyCube-REST-API-Version=0.1.1
        X-Android-Selected-Protocol=http/1.1
        Strict-Transport-Security=max-age=31536000max-age=15768000;
        Cache-Control=max-age=0, private, must-revalidate
        ETag=W/"54cbacd5614f877cdc525458d3006000"
        X-Android-Response-Source=NETWORK 200
        Set-Cookie=_mkra_ctxt=b7ab6f623799abbe35473fcbddb5e3b3--200; path=/; max-age=5; HttpOnly; secure
        X-Android-Sent-Millis=1569954745120
        X-XSS-Protection=1; mode=block
        Content-Type=application/json; charset=utf-8
    BODY
        '{"total_entries":0,"skip":0,"limit":10,"items":[]}'
D/ChatRepository$loadChats: shouldFetch result= false
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.connectycube.messenger, PID: 11267
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.get(ArrayList.java:437)
        at com.connectycube.messenger.ChatDialogActivity$subscribeUi$$inlined$observe$1.onChanged(LiveData.kt:56)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at androidx.lifecycle.Transformations$1.onChanged(Transformations.java:76)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at com.connectycube.messenger.viewmodels.ChatDialogListViewModel$getChats$1.onChanged(ChatDialogListViewModel.kt:33)
        at com.connectycube.messenger.viewmodels.ChatDialogListViewModel$getChats$1.onChanged(ChatDialogListViewModel.kt:13)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at com.connectycube.messenger.vo.NetworkBoundResource.setValue(NetworkBoundResource.kt:56)
        at com.connectycube.messenger.vo.NetworkBoundResource.access$setValue(NetworkBoundResource.kt:21)
        at com.connectycube.messenger.vo.NetworkBoundResource$1$1$1.onChanged(NetworkBoundResource.kt:46)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:144)
        at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:443)
        at androidx.lifecycle.LiveData.observeForever(LiveData.java:232)
        at androidx.lifecycle.MediatorLiveData$Source.plug(MediatorLiveData.java:141)
        at androidx.lifecycle.MediatorLiveData.addSource(MediatorLiveData.java:96)
        at com.connectycube.messenger.vo.NetworkBoundResource$1$1.onChanged(NetworkBoundResource.kt:45)
        at com.connectycube.messenger.vo.NetworkBoundResource$1$1.onChanged(NetworkBoundResource.kt:21)
        at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152)
        at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
        at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
        at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
        at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
        at androidx.lifecycle.LiveData$1.run(LiveData.java:91)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7050)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
I/Process: Sending signal. PID: 11267 SIG: 9
Process 11267 terminated.

I suspect that this is because there is no dialog to fetch

AnnBenavides commented 4 years ago

Indeed is a bug, here is the solution to start a dialog commenting a line and checking some nulls.

TatankaConCube commented 4 years ago

Fixed in version 1.1.0