amplitude / Amplitude-Android

Native Android SDK for Amplitude
MIT License
161 stars 90 forks source link

AmplitudeSDK.logEvent java.util.ConcurrentModificationException occurs #404

Closed Kanchan-tech1994 closed 4 months ago

Kanchan-tech1994 commented 5 months ago

OnFirebase crashlytics, Amplitude SDK occurs below attached crash rapidly but while debugging on device it doesn't occurs(For a long time multiple users).

Using 'com.amplitude:android-sdk:2.40.1'

According to below logs while sending screenview event by BaseActivity which is extending by all other activities it occurs.

keyboard_arrow_up java.util.LinkedHashMap$LinkedHashIterator.nextNode (LinkedHashMap.java:757) arrow_drop_down com.amplitude.api.AmplitudeClient.logEvent (AmplitudeClient.java:923) arrow_right com.Dummy.analytics.client.AmplitudeSDK.logEvent (AmplitudeSDK.kt:108) com.Dummy.utils.event.EventBuilder.build (EventBuilder.java:330) com.Dummy.analytics.screenView.ScreenViewEvents.sendAmplitudeEvent (ScreenViewEvents.kt:173) com.Dummy.analytics.screenView.ScreenViewEvents.send (ScreenViewEvents.kt:28) com.Dummy.activity.BaseActivity.sendScreenViewEvent (BaseActivity.java:2742) com.Dummy.activity.fragment.next_gen_home.NextGenHomeFragment.onViewCreated (NextGenHomeFragment.kt:388) androidx.fragment.app.Fragment.performViewCreated (Fragment.java:3137) arrow_drop_down androidx.appcompat.app.AppCompatActivity.onStart (AppCompatActivity.java:251) com.Dummy.activity.BaseActivity.onStart (BaseActivity.java:236) android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1436) arrow_drop_down com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1006)

justin-fiedler commented 5 months ago

Hi @Kanchan-tech1994 thanks for choosing Amplitude!

This is our older Android SDK which is in maintenance and no longer actively maintained.

Could you please upgrade to the latest SDK which likely resolves this issue? Thank you!

Kanchan-tech1994 commented 1 month ago

hello @justin-fiedler Thanks for your response.

We have updated our SDK as per your suggestion but still getting the same crash occurs.

SDK which we are currently using -> com.amplitude:analytics-android:1.+

Updating SDK doesn't resolve our issue.

Fatal Exception: java.util.ConcurrentModificationException keyboard_arrow_up java.util.HashMap$HashIterator.nextNode (HashMap.java:1603) arrow_drop_down com.amplitude.core.Amplitude.track$default (Amplitude.kt:175) arrow_right com. Dummy.analytics.client.AmplitudeSDK.logEvent (AmplitudeSDK.kt:106) com. Dummy.utils.event.EventBuilder.build (EventBuilder.java:315) com. Dummy.analytics.screenView.ScreenViewEvents.sendAmplitudeEvent (ScreenViewEvents.kt:173) com. Dummy.analytics.screenView.ScreenViewEvents.send (ScreenViewEvents.kt:28) com. Dummy.activity.BaseActivity.sendScreenViewEvent (BaseActivity.java:2603) com. Dummy.activity.fragment.next_gen_home.NextGenHomeFragment.onViewCreated (NextGenHomeFragment.kt:387) androidx.fragment.app.Fragment.performViewCreated (Fragment.java:3137) arrow_drop_down androidx.appcompat.app.AppCompatActivity.onStart (AppCompatActivity.java:251) com.Dummy.activity.BaseActivity.onStart (BaseActivity.java:233) android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1582) arrow_drop_down com.android.internal.os.ZygoteInit.main (ZygoteInit.java:992)