[$175] Android - Plaid login page rotates to landscape instead of remaining in portrait
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.5.34-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://github.com/Expensify/App/pull/105598 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Samsung Galaxy S21 FE/Android 16 App Component: Other
Action Performed:
- Launch Expensify app
- Tap Profile
- Tap Wallet
- Tap Add bank account, select United States and tap Regions Bank
- Tap the Online ID field
- Rotate the device to landscape
- Exit Plaid and reopen it while the device is in landscape
Expected Result:
Plaid remains in portrait orientation on Android phones, including when reopened while the device is in landscape.
Actual Result:
Plaid rotates to landscape along with the device. When reopened in landscape, Plaid also displays in landscape instead of portrait.
Workaround:
Unknown
Platforms:
- [x] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [ ] Windows: Chrome
- [ ] MacOS: Chrome Safari
Screenshots/Videos
https://github.com/user-attachments/assets/7b5b955a-68ff-4e06-be8a-d8253f63c665
Applause Internal Information Exported by: Julia Ponikarchuk Bug ID: 7308232
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022119666681731312773
- Upwork Job ID: 2119666681731312773
- Last Price Increase: 2026-11-09
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/5a2583566b4a5ae52084ad10f996cc97d5effc40e1ac7d7b4179dd4ca014b731
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)
Job added to Upwork: https://www.upwork.com/jobs/~022119666681731312773
🤖 Web test steps verification results: ⚠️ partial
Verified app, Profile, and Wallet on web. An emailed security-code gate blocked bank selection; Android orientation cannot be validated on web.
| Step | Status |
|---|---|
1. Launch appHome snapshot confirmed the app was running. |
✅ |
2. Open ProfileSnapshot confirmed Profile. |
✅ |
3. Open WalletSnapshot confirmed Wallet and Add bank account. |
✅ |
4. Add bank account → United States → Regions BankAccount validation required an emailed security code. Country and bank selection were not reached.![]() |
⚠️ |
5. Tap Online IDBlocked by account validation; the field was not reached. |
⚠️ |
6. Rotate Android phone; Plaid remains portraitCannot verify native Android orientation on web. |
⚠️ |
7. Reopen Plaid while landscape; Plaid opens portraitCannot verify native Android reopening behavior on web. |
⚠️ |
Issue Analysis
⚠️ Preliminary analysis — root cause remains unconfirmed.
Finding: The reported-version App source already explicitly locks Plaid to portrait on phones. Adding another portrait request is therefore not a verified solution. The unresolved boundary is whether the tested native build executes that policy and whether its orientation request is subsequently overridden.
Code evidence and hypothesis checks
- In the reported staging tag,
MainApplication.kt:70–83recognizes Plaid’s activity and applies the orientation policy when it opens. MainApplication.kt:126–142reapplies the policy on configuration changes: below 600dp, it requests portrait; at or above 600dp, it permits rotation. The Android 8.0 exception does not explain this Android 16 report.- Current main contains the same policy, not a later correction.
- Keep Plaid in portrait on Android phones so its inputs stay visible attempted to restrict existing landscape behavior; the evidence does not establish that it introduced this failure.
- Alternative explanations remain unverified: the shipped policy is not executed, the device enters the ≥600dp branch, or the SDK/platform overrides the request. Android 16 alone does not establish which occurred.
Recommended next investigation: An internal engineer should inspect the tested Android build and capture the active Plaid activity, effective screen-width classification, and requested orientation during opening, rotation, and reopening. This distinguishes the remaining explanations before selecting a fix. Backend logs would not establish those native activity states.
Related issue: Wallet—in landscape, input hidden and cursor shifts right after typing tracks the underlying landscape-input problem this portrait restriction intended to address.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
Proposal
What is the root cause of that problem?
In android/app/src/main/java/com/expensify/chat/MainApplication.kt:
applyPlaidOrientation is currently only invoked inside onActivityCreated (and in Application.onConfigurationChanged if the configuration changes while Plaid is alive).
However:
LinkActivityinAndroidManifest.xmlis declared withandroid:launchMode="singleTask":<activity android:name="com.plaid.internal.link.LinkActivity" android:launchMode="singleTask" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" tools:replace="android:launchMode"/>- When a user exits Plaid, rotates the device to landscape, and re-opens Plaid from Expensify,
LinkActivityis restarted or resumed from the task stack (onRestart->onStart->onResume). Because the activity was already instantiated,onActivityCreatednever fires again. - Because
onActivityStartedandonActivityResumedinMainApplication.ktare currently empty no-op stubs (override fun onActivityStarted(activity: Activity) {}),applyPlaidOrientationis never re-applied when Plaid is reopened while the host app is in landscape. - Furthermore, if
plaidLinkActivitywas cleared or not refreshed,Application.onConfigurationChangedcannot re-assert portrait lock on the active instance. Consequently, Plaid inherits the landscape window orientation, causing the keyboard to obscure the login inputs on phones.
What changes do you think we should make in order to solve the problem?
In android/app/src/main/java/com/expensify/chat/MainApplication.kt:
- In
registerActivityLifecycleCallbacks:- Store/refresh the
plaidLinkActivityweak reference and invokeapplyPlaidOrientationinonActivityStartedandonActivityResumedas well asonActivityCreated:
override fun onActivityStarted(activity: Activity) { if (activity.javaClass.name == "com.plaid.internal.link.LinkActivity") { plaidLinkActivity = WeakReference(activity) applyPlaidOrientation(activity, activity.resources.configuration) } } override fun onActivityResumed(activity: Activity) { if (activity.javaClass.name == "com.plaid.internal.link.LinkActivity") { plaidLinkActivity = WeakReference(activity) applyPlaidOrientation(activity, activity.resources.configuration) } } - Store/refresh the
- In
applyPlaidOrientation:- Ensure the portrait lock is strictly enforced on all phones (
config.smallestScreenWidthDp < 600) whenever the activity is active, started, or resumed, while preserving landscape for tablets:
private fun applyPlaidOrientation(activity: Activity, config: Configuration) { if (config.smallestScreenWidthDp >= 600) { activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED return } // Android 8.0 throws when a translucent activity requests a fixed orientation; Plaid skips it there too. if (Build.VERSION.SDK_INT != Build.VERSION_CODES.O) { activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT } } - Ensure the portrait lock is strictly enforced on all phones (
- HybridApp parity note: Since native activity lifecycle callbacks in
MainApplication.ktmirror across NewDot and Mobile-Expensify, this fix applies cleanly to both standalone and hybrid builds without introducing regression risks to non-Plaid activities.
What alternative solutions did you explore? (Optional)
Attempting to lock orientation from the React Native JS layer via orientation hooks was considered. However, Plaid's LinkActivity runs in a native Android activity layer outside the React Native view hierarchy. Centralizing the lifecycle listener inside MainApplication.kt's registerActivityLifecycleCallbacks (onActivityStarted & onActivityResumed) ensures Plaid is unconditionally locked to portrait on Android phones across all open, reopen, resume, and rotation transitions.
Tests
- On an Android phone, launch the Expensify app.
- Tap Profile > Wallet.
- Tap Add bank account, select United States, and tap Regions Bank.
- On the Plaid login screen, tap the Online ID field and rotate the device to landscape.
- Verify Plaid remains in portrait orientation and the Online ID field remains clearly visible above the keyboard.
- Tap back to exit Plaid, rotate the device to landscape.
- Reopen Plaid while the device is in landscape.
- Verify Plaid opens and remains in portrait orientation without rotating to landscape or showing a white page.
- On an Android tablet, repeat steps 1–4 and verify Plaid can rotate to landscape as expected.
- Contributor: @kevinjosh10
- Expensify Account Email: [email protected]
- Upwork Profile: https://www.upwork.com/freelancers/~0131dae36abcf59374
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0131dae36abcf59374
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0179cdc82689f205c7
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android, opening the Plaid bank authentication webview/activity allows the screen to rotate to landscape orientation instead of remaining locked in portrait mode.
What is the root cause of that problem?
The Android activity configuration launched for Plaid Link (PlaidLinkActivity or external auth browser activity) does not specify android:screenOrientation="portrait" in AndroidManifest.xml, allowing system auto-rotation settings to override the app's portrait lock during banking flows.
What changes do you think we should make in order to solve the problem?
- In
android/app/src/main/AndroidManifest.xml, ensurescreenOrientation="portrait"is explicitly defined for all Plaid/OAuth activities:<activity android:name="com.plaid.link.PlaidLinkActivity" android:screenOrientation="portrait" android:configChanges="orientation|screenSize" /> - In
src/libs/Plaid/index.android.ts, enforceScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT)prior to opening the Plaid Link dialog.
What alternative solutions did you explore? (Optional)
- Allowing landscape for Plaid: Rejected because Plaid's UI components and Expensify's parent modal are designed specifically for portrait, causing truncated form elements in landscape.
What automated tests can you add to prevent this from re-occurring?
In unit/integration tests:
- Add a test verifying that launching the bank connection flow invokes
lockAsyncwithPORTRAITlock.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~013d295f05a578824b
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Android phones:
- When opening Plaid bank login (
Profile > Wallet > Add bank account > United States > [Bank]), focusing the credential input, and rotating the device to landscape, Plaid rotates to landscape along with the device. - Exiting Plaid, rotating the device to landscape, and reopening Plaid from Expensify while in landscape results in Plaid displaying in landscape instead of remaining locked in portrait.
What is the root cause of that problem?
In android/app/src/main/java/com/expensify/chat/MainApplication.kt:
-
Missing orientation enforcement on resume / restart (
singleTasklifecycle): Inandroid/app/src/main/AndroidManifest.xml:167-172,LinkActivityis declared withandroid:launchMode="singleTask"andandroid:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode":<activity android:name="com.plaid.internal.link.LinkActivity" android:launchMode="singleTask" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" tools:replace="android:launchMode"/>When the user exits Plaid, the activity is stopped rather than destroyed. When Plaid is reopened from the host app while the device is in landscape, Android does not re-create the activity; it delivers an intent and runs
onRestart()->onStart()->onResume(). BecauseMainApplication.ktonly callsapplyPlaidOrientationinonActivityCreated—leavingonActivityStartedandonActivityResumedas empty stubs:override fun onActivityStarted(activity: Activity) {} override fun onActivityResumed(activity: Activity) {}onActivityCreatednever fires on reopen, andapplyPlaidOrientationis never re-applied.LinkActivitytherefore inherits the landscape window configuration of the parent task. -
Plaid OAuth / WebView configuration changes: Because
LinkActivityhandlesorientation|screenSizeinandroid:configChanges, rotating the device while Plaid is open (e.g. on Regions Bank OAuth / credential webview) dispatchesonConfigurationChangeddirectly toLinkActivity. IfplaidLinkActivitywas not refreshed upon resume or if the webview resets the orientation request upon loading,applyPlaidOrientationmust be re-asserted throughout the activity's active lifecycle states (startedandresumed) so the window manager consistently locks the orientation to portrait on phones.
What changes do you think we should make in order to solve the problem?
-
Update
registerActivityLifecycleCallbacksinandroid/app/src/main/java/com/expensify/chat/MainApplication.kt:- In
onActivityStartedandonActivityResumed, check if the activity is"com.plaid.internal.link.LinkActivity", refreshplaidLinkActivity = WeakReference(activity), and invokeapplyPlaidOrientation(activity, activity.resources.configuration):override fun onActivityStarted(activity: Activity) { if (activity.javaClass.name == "com.plaid.internal.link.LinkActivity") { plaidLinkActivity = WeakReference(activity) applyPlaidOrientation(activity, activity.resources.configuration) } } override fun onActivityResumed(activity: Activity) { if (activity.javaClass.name == "com.plaid.internal.link.LinkActivity") { plaidLinkActivity = WeakReference(activity) applyPlaidOrientation(activity, activity.resources.configuration) } } - Retain the cleanup in
onActivityDestroyed:override fun onActivityDestroyed(activity: Activity) { if (plaidLinkActivity?.get() === activity) { plaidLinkActivity = null } }
- In
-
Ensure
applyPlaidOrientationmaintains tablet landscape support: Keep the tablet check (config.smallestScreenWidthDp >= 600 -> ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) so tablet users continue to have full landscape support per PR #105598, while locking phones (smallestScreenWidthDp < 600) toActivityInfo.SCREEN_ORIENTATION_PORTRAIT(with the Android 8.0Build.VERSION.SDK_INT != Build.VERSION_CODES.Oguard):private fun applyPlaidOrientation(activity: Activity, config: Configuration) { if (config.smallestScreenWidthDp >= 600) { activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED return } if (Build.VERSION.SDK_INT != Build.VERSION_CODES.O) { activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT } }
What alternative solutions did you explore? (Optional)
- Hardcoding
android:screenOrientation="portrait"onLinkActivityinAndroidManifest.xml:- Rejected because hardcoding portrait in the manifest forces portrait orientation on tablets as well, violating the explicit tablet landscape requirement established in PR #105598 ($102562).
- Locking orientation from React Native JS via
ScreenOrientation.lockAsync:- Rejected because Plaid's
LinkActivityis a native Android activity launched outside the React Native view hierarchy; JS-level orientation locks only controlMainActivity(ReactActivity) and do not reliably govern Plaid's window manager parameters.
- Rejected because Plaid's
Tests
- On an Android phone:
- Launch the Expensify app.
- Navigate to
Profile > Wallet > Add bank account > United States > Regions Bank. - On the Plaid credential screen, tap the Online ID field and rotate the device to landscape.
- Verify Plaid remains in portrait orientation and the Online ID field remains clearly visible above the keyboard.
- Exit Plaid, rotate the device to landscape, and tap "Log into your bank" to reopen Plaid while the app is in landscape.
- Verify Plaid opens and remains locked in portrait orientation without rotating to landscape or rendering a blank page.
- On an Android tablet:
- Repeat the bank connection flow and verify Plaid can freely rotate to landscape as expected.
— submitted with Antigravity on the contributor's behalf
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Hey @hoangzinh, I checked the Mobile-Expensify pins for 9.5.34-0 and 9.5.36-0. Both predate the merge of Expensify/Mobile-Expensify#14216. Could you confirm which Android HybridApp build includes that fix so QA can retest on the Galaxy S21 FE with Android 16? Thanks.
I think it's 9.5.37-0 https://github.com/Expensify/Mobile-Expensify/pull/14216#issuecomment-6818878089
Not overdue, I haven't had time to come back here yet.
Not overdue, I haven't had time to come back here yet.
@brunovjk any news here? can we ask retest?
@brunovjk this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@brunovjk Huh... This is 4 days overdue. Who can take care of this?
Not overdue, I haven't had time to come back here yet.
@brunovjk any news here? can we ask retest?
Yes. I’m trying to reproduce it, but I’m having some issues with my Mac; I’m just finishing sorting that out and will test i. Thanks.
I believe I can reproduce it, but I'm not entirely sure:
https://github.com/user-attachments/assets/094d46d3-bcf3-43eb-adda-e719e6e97ff0
What do you think, @mukhrr? Are you able to reproduce it? Thanks.
@brunovjk exactly. this is expected behavior. thanks. I think we can ask re-test and close
Expected Result: Plaid remains in portrait orientation on Android phones, including when reopened while the device is in landscape.
I asked for a retest here. Thank you.
I'm unable to reproduce.
https://github.com/user-attachments/assets/85245013-8360-4f90-b586-d985aea55274