crisp-im / crisp-sdk-android

:package: Crisp Android SDK, add a chat in any Android app and communicate with your users.
https://docs.crisp.chat/guides/chatbox-sdks/android-sdk/
Other
56 stars 17 forks source link

E/CrispSocket: (Initialization Error) Error starting chat on Android 7, 8 #127

Closed oanaperes closed 2 years ago

oanaperes commented 2 years ago

When trying to open chat we get "Error starting chat" and we can try again as many times as we like but it never opens. This happens on Samsung Galaxy S6 Edge with Android 7.0, Nexus 6P with Android 8.1.0. Environment: "react-native-crisp-chat-sdk": "0.10.2", 'im.crisp:crisp-sdk:1.0.9', targetSdkVersion = 31, "react-native": "0.66.4".

Logs From Android Studio when "Error Starting chat" is received: "2022-07-28 10:07:[11.687 29765-29857](callto:11.687 29765-29857)/com.client I/CrispSocket: Chat initialization timeout has been exceeded. 2022-07-28 10:07:[11.688 29765-29857](callto:11.688 29765-29857)/com.client D/CrispSocket: Disconnecting… 2022-07-28 10:07:[11.688 29765-29857](callto:11.688 29765-29857)/com.client D/CrispSocket: Clearing chat initialization timeout. 2022-07-28 10:07:[11.692 29765-29857](callto:11.692 29765-29857)/com.client E/CrispSocket: (Initialization Error) Error starting chat 2022-07-28 10:07:[11.701 29765-30210](callto:11.701 29765-30210)/com.client E/CrispSocket: A websocket error occured. Name: connect_timeout Args: [ 15000 ]"

Sometimes app crashes when "try again" is hit, with this error: logs fron android studio ""2022-07-26 12:37:[04.958 13140-13140](callto:04.958 13140-13140)/com.client E/AndroidRuntime: FATAL EXCEPTION: main Process: com.undoiclient, PID: 13140 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.client/im.crisp.client.ChatActivity}: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment im.crisp.client.internal.ui.a.a.c: could not find Fragment constructor at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4699) at android.app.ActivityThread.-wrap18(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1595) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)"

Doc1faux commented 2 years ago

Hello @oanaperes and thank you for your feedback.

About the crash when the "Try again" button is hit, it has been fixed in 1.0.12 (see #109).

Concerning the "Error starting chat", this is a duplicated of #104.

So I will close this issue but I will add in #104 your comment about the devices and versions on which you reproduce it. I let you track the progress on this issue instead. Unfortunately, as I have none of these devices, it will be hard for me to reproduce it :/