Error in CometChat Login

Hi
We are getting errors in the Cometchat login.
Below are the logs (in android studio logcat):
com.cometchat.pro.exceptions.CometChatException: No Internet Connection. Please try again later.
2020-02-03 22:26:01.510 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.ApiConnection.makeApiCall(ApiConnection.java:975)
2020-02-03 22:26:01.510 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.ApiConnection.login(ApiConnection.java:281)
2020-02-03 22:26:01.510 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.CometChat.loginWithAuthTokenInternal(CometChat.java:637)
2020-02-03 22:26:01.510 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.CometChat.login(CometChat.java:628)
2020-02-03 22:26:01.510 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity.a(LoginActivity.java:333)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity.a(LoginActivity.java:60)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity$c.a(LoginActivity.java:362)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity$c.onSuccess(LoginActivity.java:358)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.CometChat$46.onResponse(CometChat.java:1733)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.ApiConnection.makeApiCall(ApiConnection.java:975)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.ApiConnection.logout(ApiConnection.java:543)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.CometChat.logout(CometChat.java:1718)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity.i(LoginActivity.java:358)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity.p(LoginActivity.java:386)
2020-02-03 22:26:01.511 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity.onSuccess(LoginActivity.java:674)
2020-02-03 22:26:01.514 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.MyApplication$a.a(MyApplication.java:56)
2020-02-03 22:26:01.514 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.MyApplication$a.onSuccess(MyApplication.java:49)
2020-02-03 22:26:01.514 28350-28350/com.iosite.iositewatchapp W/System.err: at com.cometchat.pro.core.CometChat.init(CometChat.java:411)
2020-02-03 22:26:01.514 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.MyApplication.a(MyApplication.java:49)
2020-02-03 22:26:01.515 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity.t(LoginActivity.java:660)
2020-02-03 22:26:01.515 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity.b(LoginActivity.java:60)
2020-02-03 22:26:01.517 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Activity.Login.LoginActivity$a.onRecieve(LoginActivity.java:267)
2020-02-03 22:26:01.517 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Network.NetworkUpdateListener.onResponse(NetworkUpdateListener.java:23)
2020-02-03 22:26:01.519 28350-28350/com.iosite.iositewatchapp W/System.err: at com.iosite.iositewatchapp.Network.GsonObjectRequest.deliverResponse(GsonObjectRequest.java:144)
2020-02-03 22:26:01.519 28350-28350/com.iosite.iositewatchapp W/System.err: at e.c.a.f$b.run(ExecutorDelivery.java:102)
2020-02-03 22:26:01.519 28350-28350/com.iosite.iositewatchapp W/System.err: at android.os.Handler.handleCallback(Handler.java:873)
2020-02-03 22:26:01.519 28350-28350/com.iosite.iositewatchapp W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
2020-02-03 22:26:01.519 28350-28350/com.iosite.iositewatchapp W/System.err: at android.os.Looper.loop(Looper.java:193)
2020-02-03 22:26:01.520 28350-28350/com.iosite.iositewatchapp W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6680)
2020-02-03 22:26:01.520 28350-28350/com.iosite.iositewatchapp W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2020-02-03 22:26:01.520 28350-28350/com.iosite.iositewatchapp W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
2020-02-03 22:26:01.520 28350-28350/com.iosite.iositewatchapp W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2020-02-03 22:26:01.521 28350-28350/com.iosite.iositewatchapp D/LoginActivity: onError123: No Internet Connection. Please try again later.
2020-02-03 22:26:01.521 28350-28350/com.iosite.iositewatchapp D/LoginActivity: onError456: No Internet Connection. Please try again later.

We started getting this after we wrote the following in build.gradle file of our app:
minifyEnabled true
shrinkResources true

Need help

Hello @kamran_iosite
From the logs provided we can see that the only exception is that there is no internet available for the CometChat SDK to connect to its API servers. Please check if the device has an active internet connection before Calling any methods provided by CometChat SDK.
If you are still facing this issue, please get back to us and also mention the version of the CometChat Android SDK you are using so that we can get this checked at our end.
Hope this helps

1 Like