PostHog / posthog-react-native-session-replay

Session Replay for React Native
MIT License
7 stars 0 forks source link

Session replay on Android crashed and cannot pass Play Store review #4

Closed hivelydev closed 1 week ago

hivelydev commented 3 weeks ago

Hi team,

First of all, congrats on rolling out these features! I love it, but I also wish to report first issue :)

As soon as I enabled the session replay, for Android it will crash the devices and throw the following errors:

Exception java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
  at java.util.ArrayList.get (ArrayList.java:437)
  at android.view.ViewGroup.onInitializeAccessibilityNodeInfoInternal (ViewGroup.java:3787)
  at android.view.View$AccessibilityDelegate.onInitializeAccessibilityNodeInfo (View.java:29681)
  at androidx.core.view.AccessibilityDelegateCompat.onInitializeAccessibilityNodeInfo (AccessibilityDelegateCompat.java:281)
  at androidx.customview.widget.ExploreByTouchHelper.onInitializeAccessibilityNodeInfo (ExploreByTouchHelper.java:757)
  at com.facebook.react.uimanager.ReactAccessibilityDelegate.onInitializeAccessibilityNodeInfo (ReactAccessibilityDelegate.java:415)
  at androidx.core.view.AccessibilityDelegateCompat$AccessibilityDelegateAdapter.onInitializeAccessibilityNodeInfo (AccessibilityDelegateCompat.java:89)
  at android.view.View.onInitializeAccessibilityNodeInfo (View.java:8609)
  at android.view.View.createAccessibilityNodeInfoInternal (View.java:8570)
  at android.view.View$AccessibilityDelegate.createAccessibilityNodeInfo (View.java:29780)
  at android.view.View.createAccessibilityNodeInfo (View.java:8553)
  at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode (AccessibilityInteractionController.java:1271)
  at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode (AccessibilityInteractionController.java:1294)
  at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos (AccessibilityInteractionController.java:1096)
  at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread (AccessibilityInteractionController.java:342)
  at android.view.AccessibilityInteractionController.access$400 (AccessibilityInteractionController.java:75)
  at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage (AccessibilityInteractionController.java:1460)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:223)
  at android.app.ActivityThread.main (ActivityThread.java:7664)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947)

Here is my PostHog config:

Screenshot 2024-09-26 at 12 58 58 PM

I am unsure what the root cause is, but disabling the session replay fixes the issue.

marandaneto commented 2 weeks ago

Hello, thanks for the issue. Seems to be related to https://github.com/PostHog/posthog-android/issues/183 and https://github.com/PostHog/posthog-android/issues/161 Sadly I never managed to reproduce this issue and no one else ever provided a reproducible sample. I'll be happy if you can provide such a sample so we can reproduce and fix it, looking forward to figuring this out with you.

marandaneto commented 2 weeks ago

@hivelydev opened a PR to at least have better logging of what going on. https://github.com/PostHog/posthog-android/pull/196