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
55 stars 17 forks source link

ClassCastException HttpURLConnectionImpl cannot be cast to javax.net.ssl.HttpsURLConnection #140

Closed Damien-L closed 1 year ago

Damien-L commented 1 year ago

Hi,

We faced this issue. 2 occurrences for now with a Samsung Android 12 (20 oct. 2022, 18:05:33 and 20 oct. 2022, 18:06:00). Crisp SDK 1.0.13.

Caused by java.lang.ClassCastException: com.android.okhttp.internal.huc.HttpURLConnectionImpl cannot be cast to javax.net.ssl.HttpsURLConnection at im.crisp.client.internal.b.b$f.a(SourceFile:56) at im.crisp.client.internal.b.b$f.doInBackground(SourceFile:2) at android.os.AsyncTask$3.call(AsyncTask.java:394) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:920)

Doc1faux commented 1 year ago

Hi @Damien-L and thank your for your feedback.

This crash occurs because of loading a preview image or GIF with a http scheme. I was assuming all media to be loaded with a https scheme.

I updated the code to handle both.

It will be available in the next 1.0.14 release. I will let you know when it will be published ;)

Doc1faux commented 1 year ago

@Damien-L 1.0.14 fixing this issue has just been released. It can take a few hours before it will be available. I close the issue.