Closed kastriotrama closed 2 years ago
Hi @kastriotrama and thank you for your feedback.
I tried to reproduce your crash creating a brand new Kotlin app (as this is the exception thrown) as is and I didn't reproduced the crash :/
Then, I tried to import up-to-date socket.io-client
, okhttp
and/or retrofit
libraries as it seems to be related to them but I still not reproduce the crash :/ (I say up-to-date as we use previous versions for Socket.IO to be compatible with Crisp servers and OkHttp and Retrofit to be compatible with Android 4.4).
Then I searched specifically for your crash and found this socket.io-client issue.
At OkHttp, I found this issue too, but the fix does not seem to have been backported to v3.12.x
...
Could you try to import v3.14.6
of the OkHttp library in your gradle file to know if it fixes your crash?
implementation 'com.squareup.okhttp3:okhttp:3.14.6'
If so, @baptistejamin we should discuss about dropping Android 4.4 support...
Tried it with v3.14.6
but still crashed, updating to the latest v4.9.2
fixed the issue, thank you for your detailed response @Doc1faux
Even though it opens up the activity it throws this exception.
Do you deploy your app on a Xiaomi device? Because it seems related to a firmware issue on MIUI while calling Activity.recreate()
which Crisp SDK does to apply the correct Chat theming according to the website settings.
As I don't own a Xiaomi device to reproduce this crash, I could only provide you a workaround I found which seems to work for some people by disabling auto-dark feature, let me know if it works for you :)
Set forceDarkAllowed
to false
to your app theme and to CrispTheme
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
</style>
<style name="CrispTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
</style>
</resources>
updating to the latest
v4.9.2
fixed the issue
So @baptistejamin do we drop the Android 4.4 support to avoid this crash for kotlin developers?
@Doc1faux go for it
Tried it with
v3.14.6
but still crashed, updating to the latestv4.9.2
fixed the issue, thank you for your detailed response @Doc1fauxEven though it opens up the activity it throws this exception.
![]()
I moved this crash in new https://github.com/crisp-im/crisp-sdk-android/issues/99 as I close this issue for the fix in 1.0.10
of the first crash due to OkHttp.
While using the latest crisp sdk(1.0.9), everytime the user tries it for the first time it throws this error, but after it comes back the second time it works, and it won't throw the error even if the user force closes the app.
@Doc1faux @baptistejamin