android-client
android-client copied to clipboard
GsonPreconditions: NoClassDefFoundError
It appears that you are using a deprecated method from the GSON library. It's GsonPreconditions.checkNotNull().
@Deprecated
public static <T> T checkNotNull(T obj) {
if (obj == null) {
throw new NullPointerException();
}
return obj;
}
After some dependency updates, we started getting this crash immediately when the app starts, and the Split client is initiated. I think some other library updated the GSON version, where that class is already removed. Please, see the stacktrace below.
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/internal/$Gson$Preconditions;
at io.split.android.client.service.sseclient.sseclient.SseRefreshTokenTimer.<init>(SseRefreshTokenTimer.java:24)
at io.split.android.client.SplitFactoryHelper.getPushNotificationManager(SplitFactoryHelper.java:259)
at io.split.android.client.SplitFactoryHelper.buildStreamingComponents(SplitFactoryHelper.java:371)
at io.split.android.client.SplitFactoryImpl.<init>(SplitFactoryImpl.java:215)
at io.split.android.client.SplitFactoryImpl.<init>(SplitFactoryImpl.java:104)
at io.split.android.client.SplitFactoryBuilder.build(SplitFactoryBuilder.java:67)
Your library uses com.google.code.gson:gson:2.10.1 but our other dependency uses com.google.code.gson:gson:2.13.0.
Could you please update the GSON and fix this issue? Thank you
Based on this: https://github.com/google/gson/releases/tag/gson-parent-2.13.0, you use the internal GSON class, that was renamed.
+1, this has become an issue for our app after updating other libraries that provide Gson 2.13.0 as a transitive dependency (e.g., https://github.com/intercom/intercom-android/releases/tag/15.16.1).
Please prioritize this issue
Hi @dostalleos, thanks for flagging this. We'll take a look.
@gthea, thanks for your response. Do you have any updates on the timeline by chance?
Version 5.3.0-rc1 is available and should fix this; stable will be out by next week.
Hi @dostalleos, @seankim-android, version 5.3.0 has been released with a fix for this.