plaidev / karte-android-sdk

KARTE SDK for Android
https://karte.io/
Apache License 2.0
5 stars 3 forks source link

Using core 2.21.0 and notifications 2.9.1 would crash due to binary-incompatibility #20

Closed ikesyo closed 1 year ago

ikesyo commented 1 year ago

Expected Behavior

An app would not crash.

Current Behavior

An app crashes when launching.

Possible Solution

Release new notifications version which depends on core 2.21.0, not 2.20.0.

Steps to Reproduce

1. 2. 3. 4.

SDK Version

Build Environment

Context Details

Logs

java.lang.NoSuchMethodError: No direct method <init>(Lio/karte/android/tracking/EventName;Ljava/util/Map;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Lio/karte/android/tracking/Event; or its super classes (declaration of 'io.karte.android.tracking.Event' appears in ...

This is due to the change of https://github.com/plaidev/karte-android-sdk/commit/4afa21326cd72caf461c4094a3b6a4a5f8cc73c0#diff-3311476b5f38e6599b17b677603af7308affe2c6d8ada94f9f6a6f98cfc8c8bfR98, which is a source-compatible change (thanks to default arguments), but isn't binary-compatible. If you had added @JvmOverloads to the constructor, this wouldn't happen.

Possible Implementation

wasnot commented 1 year ago

@ikesyo Thank you for reporting.

We are aware of this issue and are working on a release. The fixed core-2.21.1 binary has already been uploaded and will be available as soon as it is synced to the repository. Please wait for a while.

Sorry for the inconvenience this time. We will consider improving the flow to prevent releases containing such issues in the future.

wasnot commented 1 year ago

This issue has been resolved with the release of core-2.21.1, so I will close it.

wasnot commented 1 year ago

Very sorry. We found that the current response to this issue is insufficient.

There is a bug that a similar crash occurs when clicking the notification.

    java.lang.NoSuchMethodError: No direct method <init>(Lio/karte/android/tracking/MessageEventType;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V in class Lio/karte/android/tracking/MessageEvent; or its super classes (declaration of 'io.karte.android.tracking.MessageEvent' appears in base.apk)
        at io.karte.android.notifications.internal.track.ClickTracker.trackTargetPush(ClickTracker.kt:67)
        at io.karte.android.notifications.internal.track.ClickTracker.sendIfNeeded(ClickTracker.kt:47)
        at io.karte.android.notifications.MessageReceiver.onReceive(MessageReceiver.kt:42)
        ...

Work on releasing additional fixes. Please use core-2.20.0 temporarily.

wasnot commented 1 year ago

I released a fixed core-2.21.2 in the morning. https://developers.karte.io/docs/release-notes-android-sdk-v2#core-2212

We apologize for the inconvenience this time. Thank you.