parameter pendingDynamicLinkData specified as non-null is null

Solution 1:

it's a bug in the library due to a play services update. To fix it, you should explicitly declare that the pendingDynamicLinkData is nullable.

Like this:

private fun getReferralId() {
    Firebase.dynamicLinks
        .getDynamicLink(intent)
        .addOnSuccessListener(this) { pendingDynamicLinkData: PendingDynamicLinkData? ->
            pendingDynamicLinkData?.link?.getQueryParameter(
                DEEP_LINK_QUERY_PARAM_REFERRAL_ID
            )?.let { refId ->
                viewModel.saveReferralId(refId)
            }
        }
 }