After upgrading the Plaid SDK on Android from < 3.9.0 to 3.10.1 we came across a bug where returning to an already-started app process using the app icon on the home launcher would cause a blank screen to occur. Because the blank screen is owned by an Activity that our app controls, I suspected it was our problem but in reverting the downgrade (without changing app host code), the issue goes away. The issue begins in version 3.9.0 of the SDK and is non-existent on version 3.8.0). See videos below.
Note: I do not believe the bug will manifest the same way in every application. I think the fact that we are showing a blank screen is likely specific to our application and our Flutter embedding, but the fact that ourActivity is being presented rather than the Plaid SDK is the actual issue.
Environment
Android OS Version
Android 12 (32)
Android Devices/Emulators
Pixel 4XL emulator
Steps to Reproduce
From an Activity owned by the host application (ours uses launchMode:singleTop but I've also found the bug to occur using standard), launch Plaid.
Background the application
Foreground the application using the app icon (note: foregrounding via Recents does not reproduce the bug)
Activity from host application rather than SDK is shown (see note on manifestation above, this may be different depending on host application implementation)
The following logs are output on version 3.9.0 when the following is done:
App launches to launcher Activity
App starts Plaid which leads to new process being started π
App is backgrounded and foregrounded via app icon, leading to onCreate of host Activity being called
---------------------------- PROCESS STARTED (23305) for package com.betterment ----------------------------
2023-02-14 03:16:38.009 23305-23305 FlutterActivity com.betterment D onCreate
---------------------------- PROCESS STARTED (23637) for package com.betterment ----------------------------
2023-02-14 03:16:59.143 23305-23305 FlutterActivity com.betterment D onCreate
Notes:
There's a second PROCESS STARTED log that is output when Plaid starts. This happens on both 3.8.0 and 3.9.0
π In only the bugged version, tapping the icon leads to a new onCreate of the host application launcher Activity. In the version(s) without the bug, this onCreate is not logged.
Code To Reproduce Issue
We're launching Plaid using the following code:
val linkTokenConfiguration = linkTokenConfiguration {
token = linkToken
}
activity?.let {
val plaidHandler: PlaidHandler = Plaid.create(it.application, linkTokenConfiguration)
plaidHandler.open(it)
}
The problem
After upgrading the Plaid SDK on Android from <
3.9.0
to3.10.1
we came across a bug where returning to an already-started app process using the app icon on the home launcher would cause a blank screen to occur. Because the blank screen is owned by anActivity
that our app controls, I suspected it was our problem but in reverting the downgrade (without changing app host code), the issue goes away. The issue begins in version3.9.0
of the SDK and is non-existent on version3.8.0
). See videos below.Note: I do not believe the bug will manifest the same way in every application. I think the fact that we are showing a blank screen is likely specific to our application and our Flutter embedding, but the fact that our
Activity
is being presented rather than the Plaid SDK is the actual issue.Environment
Steps to Reproduce
Activity
owned by the host application (ours useslaunchMode:singleTop
but I've also found the bug to occur usingstandard
), launchPlaid
.Expected Result
See videos below.
Screenshots
Version 3.8.0 (expected)
https://user-images.githubusercontent.com/8343465/218859150-518d1c6c-0a91-41f3-80a6-76afbdfe2839.mov
Version 3.9.0 (bug)
https://user-images.githubusercontent.com/8343465/218859189-61217d9e-99a6-446f-b3eb-086df9fad196.mov
Logs
The following logs are output on version
3.9.0
when the following is done:Activity
Plaid
which leads to new process being started πonCreate
of hostActivity
being calledNotes:
3.8.0
and3.9.0
onCreate
of the host application launcherActivity
. In the version(s) without the bug, thisonCreate
is not logged.Code To Reproduce Issue
We're launching
Plaid
using the following code: