Skip to content

Crash on 1.21.0 with MutableMap properties #291

Description

@jrodbx

Describe the bug
When trying to attach the app to LayoutInspector in Android Studio with an emulator, I noticed a crash.

The stack trace shows:

2026-01-30 15:32:43.556 27323-27323 com.creditgenie.app     com.creditgenie.app                  D  Segment: Tracking event 'Link Clicked' with params: {linkText=Sign In Link}
2026-01-30 15:32:43.604 27323-27323 AndroidRuntime          com.creditgenie.app                  E  FATAL EXCEPTION: main (Fix with AI)
                                                                                                    Process: com.creditgenie.app, PID: 27323
                                                                                                    java.lang.ClassCastException: kotlin.reflect.jvm.internal.KTypeImpl cannot be cast to kotlin.jvm.internal.TypeReference
                                                                                                    	at kotlin.jvm.internal.ReflectionFactory.mutableCollectionType(ReflectionFactory.java:107)
                                                                                                    	at kotlin.jvm.internal.Reflection.mutableCollectionType(Reflection.java:197)
                                                                                                    	at presentation.common.utils.cg_analytics.clients.SegmentAnalyticsClientImpl.trackEvent(SegmentAnalyticsClientImpl.kt:161)
                                                                                                    	at presentation.common.utils.cg_analytics.clients.SegmentAnalyticsClientImpl.createEvent(SegmentAnalyticsClientImpl.kt:83)
                                                                                                    	at presentation.common.utils.cg_analytics.CGAnalyticsLoggerImpl.logEvent(CGAnalyticsLoggerImpl.kt:91)
                                                                                                    	at presentation.common.utils.cg_analytics.CGAnalyticsLogger$DefaultImpls.logEvent$default(CGAnalyticsLoggerImpl.kt:27)
                                                                                                    	at creditgenie.presentation.signin_signup.ui.authlanding.AuthLandingScreenKt$AuthLandingScreenContent$5.invoke$lambda$9$lambda$8$lambda$7$lambda$5(AuthLandingScreen.kt:184)
                                                                                                    	at creditgenie.presentation.signin_signup.ui.authlanding.AuthLandingScreenKt$AuthLandingScreenContent$5.$r8$lambda$IZzaE8SyegnLydx6ey2_lFOCPGg(Unknown Source:0)

The offending call is:

        analytics.track(
            name = eventName, // String
            properties = params // a MutableMap<String, Any?>
        )

Changing params to params.toMap() resolves the fix.

Expected behavior
A clear and concise description of what you expected to happen.
It doesn't appear that the latest release (1.24.1) has fixed the issue

Platform (please complete the following information):

  • Library Version in use: 1.21.0
  • Platform being tested: Android
  • Integrations in use: N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions