Skip to content

Attempt to invoke virtual method 'android.os.Parcelable android.content.Intent.getParcelableExtra(java.lang.String)' on a null object reference #1079

@zgordon02

Description

@zgordon02

Our app is bare workflow expo app. When invoking a universal link, segment is crashing the app. I've included the logcat logs below.

This happens even when I do not initiate the segment client in the JS layer. I am not setting trackDeepLinks to true either.

  • analytics-react-native version: 2.19.2
  • Integrations versions (if used):
  • React Native version: 0.74.3
  • iOS or Android or both? Android - Observed on older Android versions 8/12, not in 14/15

Steps to reproduce
Invoke any universal link https://{mydomain}/path

Expected behavior
Not crash

Actual behavior
Crashes

2025-06-04 09:10:43.498 30338-30338 AnalyticsReactNative    my.app.debug                  D  onNewIntent = Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=https://my.domain.com/... flg=0x14000000 cmp=my.app.debug/my.app.debug.MainActivity (has extras) }
2025-06-04 09:10:43.498 30338-30338 AndroidRuntime          my.app.debug                  D  Shutting down VM
2025-06-04 09:10:43.499 30338-30338 AndroidRuntime          my.app.debug                  E  FATAL EXCEPTION: main
                                                                                                    Process: my.app.debug, PID: 30338
                                                                                                    java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Parcelable android.content.Intent.getParcelableExtra(java.lang.String)' on a null object reference
                                                                                                    	at android.app.Activity.getReferrer(Activity.java:6370)
                                                                                                    	at com.segmentanalyticsreactnative.AnalyticsReactNativeModule.getReferrer(AnalyticsReactNativeModule.kt:178)
                                                                                                    	at com.segmentanalyticsreactnative.AnalyticsReactNativeModule.trackDeepLinks(AnalyticsReactNativeModule.kt:197)
                                                                                                    	at com.segmentanalyticsreactnative.AnalyticsReactNativeModule.onNewIntent(AnalyticsReactNativeModule.kt:248)
                                                                                                    	at com.facebook.react.bridge.ReactContext.onNewIntent(ReactContext.java:340)
                                                                                                    	at com.facebook.react.ReactInstanceManager.onNewIntent(ReactInstanceManager.java:551)
                                                                                                    	at com.facebook.react.ReactDelegate.onNewIntent(ReactDelegate.java:172)
                                                                                                    	at com.facebook.react.ReactActivityDelegate.onNewIntent(ReactActivityDelegate.java:171)
                                                                                                    	at expo.modules.ReactActivityDelegateWrapper.onNewIntent(ReactActivityDelegateWrapper.kt:280)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions