Skip to content

fix(customrow): only attach BottomTabs custom row to NavigationActivity#8336

Open
Yoavpagir wants to merge 1 commit into
wix:masterfrom
Yoavpagir:fix/customrow-attacher-skip-foreign-activities
Open

fix(customrow): only attach BottomTabs custom row to NavigationActivity#8336
Yoavpagir wants to merge 1 commit into
wix:masterfrom
Yoavpagir:fix/customrow-attacher-skip-foreign-activities

Conversation

@Yoavpagir

Copy link
Copy Markdown
Contributor

Problem

Owner (Android) crashes during OAuth login. When AppAuth's RedirectUriReceiverActivity (the relay that receives the OAuth redirect) is created, the app dies with:

RuntimeException: Unable to start activity ... RedirectUriReceiverActivity:
IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
  at BottomTabsCustomRowAttacher.tryAttach(BottomTabsCustomRowAttacher.kt:96)
  at BottomTabsCustomRowAttacher.onActivityCreated(BottomTabsCustomRowAttacher.kt:55)

Sentry: WIX-ONE-APP-9GFHV — ~5.9k events / 1.6k users, Android-only, still active.

Root cause

BottomTabsCustomRowAttacher is a global Application.ActivityLifecycleCallbacks and runs tryAttach()findViewById(android.R.id.content) on every activity in the process. For a foreign, non-AppCompat-themed activity (AppAuth's relay), that findViewById forces AppCompatDelegate sub-decor inflation, which requires a Theme.AppCompat and throws. Any third-party non-AppCompat activity (OAuth relays, SDK login flows, etc.) hits this, not just AppAuth.

Fix

Guard the observer to RNN's own NavigationActivity — the only place BottomTabs (and thus the custom row) ever live. Foreign activities are skipped, so findViewById is never called on them.

private fun ensureLayoutObserver(activity: Activity) {
    if (activity !is NavigationActivity) return
    ...
}
private fun tryAttach(activity: Activity) {
    if (activity !is NavigationActivity) return
    ...
}

Verification

Built the playground app with this change and reproduced the exact mechanism on a rooted emulator: launching a non-AppCompat-themed AppCompatActivity into the running process no longer crashes (unpatched: process dies with the stack above). The custom bottom-tabs feature still renders correctly on NavigationActivity — no regression.

BottomTabsCustomRowAttacher is a global Application.ActivityLifecycleCallbacks
that ran tryAttach()/findViewById() on every activity in the process. On a
foreign, non-AppCompat-themed activity (e.g. AppAuth RedirectUriReceiverActivity
during OAuth login) this forces AppCompat sub-decor inflation and crashes with
'You need to use a Theme.AppCompat theme'. Guard so the observer only touches
RNN's own NavigationActivity, where BottomTabs actually live.

Sentry: WIX-ONE-APP-9GFHV
@Yoavpagir
Yoavpagir marked this pull request as ready for review July 21, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant