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

ConcurrentModificationException Crash Immediately after initializing PostHog #212

Open
ubeyou opened this issue Dec 5, 2024 · 3 comments
Labels
question Further information is requested

Comments

@ubeyou
Copy link

ubeyou commented Dec 5, 2024

Version

3+

Steps to Reproduce

I have initialize posthog 3+ in the App.kt

val config = PostHogAndroidConfig(
            apiKey = POSTHOG_API_KEY,
            host = POSTHOG_HOST
        )
        PostHogAndroid.setup(this, config)

Then I'm getting Crash and I can't login anymore.

java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1111)
at java.util.ArrayList$Itr.next(ArrayList.java:1064)
at com.cisco.android.common.utils.extensions.ListExtKt.a(Unknown Source:25)
at com.cisco.android.common.utils.RootViewObserver.access$injectObserverIfNeeded(SourceFile:1)
at com.cisco.android.common.utils.RootViewObserver$c.doFrame(Unknown Source:9)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1592)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1603)
at android.view.Choreographer.doCallbacks(Choreographer.java:1125)
at android.view.Choreographer.doFrame(Choreographer.java:1026)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1567)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:224)
at android.os.Looper.loop(Looper.java:318)
at android.app.ActivityThread.main(ActivityThread.java:8790)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

Expected Result

Able to access the app

Actual Result

App crash on start. After removing the PostHog Init, it works again. Was updating from PostHog 1 to PostHog 3 earlier.

@ubeyou ubeyou added the bug Something isn't working label Dec 5, 2024
@ubeyou
Copy link
Author

ubeyou commented Dec 5, 2024

Just to update

When I downgraded to 3.0.0, no crashes, if i put any version >= 3.1.0, there will be crash on start.

@marandaneto
Copy link
Member

marandaneto commented Dec 5, 2024

@ubeyou I wonder if it's conflicting with any dependencies.
As you can see in the stack trace, you see com.cisco.android, this is not part of our SDK.

Can you add a breakpoint to somewhere here:

java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1111)
at java.util.ArrayList$Itr.next(ArrayList.java:1064)
at com.cisco.android.common.utils.extensions.ListExtKt.a(Unknown Source:25)
at com.cisco.android.common.utils.RootViewObserver.access$injectObserverIfNeeded(SourceFile:1)
at com.cisco.android.common.utils.RootViewObserver$c.doFrame(Unknown Source:9)

And see where this is happening? Thanks
Can you try the latest version? 3.9.3

@marandaneto marandaneto added question Further information is requested and removed bug Something isn't working labels Dec 5, 2024
@marandaneto
Copy link
Member

@ubeyou any more context?

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

No branches or pull requests

2 participants