Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crash due to java.lang.IncompatibleClassChangeError in gson converter #206

Open
Junaid-Ahmed-Qureshi opened this issue Jun 25, 2019 · 3 comments
Labels

Comments

@Junaid-Ahmed-Qureshi
Copy link

Junaid-Ahmed-Qureshi commented Jun 25, 2019

Issue:

We are receiving crashes on samsung devices with OS 4, 5 & 8. I'm using pusher-java-client:1.8.2 and gson:2.8.4 in my code.

Crash Report

Fatal Exception: java.lang.IncompatibleClassChangeError: Couldn’t find com.google.gson.annotations.SerializedName.value
at libcore.reflect.AnnotationAccess.toAnnotationInstance + 659(AnnotationAccess.java:659)
at libcore.reflect.AnnotationAccess.toAnnotationInstance + 641(AnnotationAccess.java:641)
at libcore.reflect.AnnotationAccess.getDeclaredAnnotation + 170(AnnotationAccess.java:170)
at java.lang.reflect.Field.getAnnotation + 242(Field.java:242)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getFieldNames + 1(ReflectiveTypeAdapterFactory.java:74)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields + 11(ReflectiveTypeAdapterFactory.java:161)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create + 4(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter + 9(Gson.java:458)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField + 4(ReflectiveTypeAdapterFactory.java:117)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields + 15(ReflectiveTypeAdapterFactory.java:166)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create + 4(ReflectiveTypeAdapterFactory.java:102)
at com.google.gson.Gson.getAdapter + 9(Gson.java:458)
at com.google.gson.Gson.fromJson + 16(Gson.java:926)
at com.google.gson.Gson.fromJson + 10(Gson.java:892)
at com.google.gson.Gson.fromJson + 4(Gson.java:841)
at com.google.gson.Gson.fromJson + 1(Gson.java:813)
at com.pusher.client.channel.impl.PresenceChannelImpl.extractPresenceDataFrom + 2(PresenceChannelImpl.java:186)
at com.pusher.client.channel.impl.PresenceChannelImpl.handleSubscriptionSuccessfulMessage + 1(PresenceChannelImpl.java:124)
at com.pusher.client.channel.impl.PresenceChannelImpl.onMessage + 3(PresenceChannelImpl.java:57)
at com.pusher.client.channel.impl.ChannelManager.onMessage + 5(ChannelManager.java:107)
at com.pusher.client.connection.websocket.WebSocketConnection.handleEvent + 3(WebSocketConnection.java:177)
at com.pusher.client.connection.websocket.WebSocketConnection.access$600 + 1(WebSocketConnection.java:27)
at com.pusher.client.connection.websocket.WebSocketConnection$6.run + 3(WebSocketConnection.java:261)
at com.pusher.client.util.Factory$1.run + 2(Factory.java:109)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1112(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 587(ThreadPoolExecutor.java:587)
at java.lang.Thread.run + 818(Thread.java:818)

This issue seems to be related to gson converter used by pusher. It is also reported here but the users are experiencing it only on Samsung devices with OS version 5 while we are experiencing on other OSs as well. Is there any workaround to avoid this crash? Does reverting back to gson:2.2.2 will fix this as this is the version currently used by your library?


CC @pusher/mobile

@Junaid-Ahmed-Qureshi
Copy link
Author

@kn100
Can you please guide regarding this issue?

@kn100
Copy link
Contributor

kn100 commented Jul 5, 2019

Hi,

Could you try using gson 2.2.2 and see if that helps? Also, share with me how you're importing gson 2.8.4.

@Junaid-Ahmed-Qureshi
Copy link
Author

Junaid-Ahmed-Qureshi commented Jul 5, 2019

Hi @kn100
Since this crash couldn't be generated by QA, using gson 2.2.2 would mean waiting for a significant time to see if it is still occuring for users. I would do this if there is no other alternative.

I'm simply importing it in my app's gradle along with pusher dependency as well. I think this import will override the one in your library.

implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.pusher:pusher-java-client:1.8.2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants