You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The initial key generation on first run will hang UI rendering including initial Widget paints or animations. This is a big issue for a live app because a new user's first impression will be that the app is clunky and slow to load.
This appears to only affect running on real devices, perhaps because the emulator is able to use underlying PC hardware generate the key faster than is noticeable.
As is, this issue prevents the app from loading any UI for between 5 and 30 seconds on first launch on a Pixel 3 running latest Android 10 build QQ2A.200305.002.
Modifying FlutterSecureStoragePlugin.java to wait for an actual channel method call to initialize the StorageCipher will result in animations completely hanging for a similar period of time.
An example app that demonstrates the problem is included below. To reproduce the issue, run the given app on a real device and time the period before the LoadingScreen is rendered. Then time it a second time after the StorageCipher has been initialized. To retest the first run case you can clear the app's storage on the test device.
@gargakshit, this issue has been fixed in the merged commit above. The fix has not yet been pushed to pub.dev, but you can depend on github code directly in your pubspec.yaml if necessary.
Activity
Fix for issue #116: Android hanging UI on StorageCipher initialization (
gargakshit commentedon May 12, 2020
I encountered the same issue yesterday, and it seems like either we have to use isolate or manually delay the key generation (workaround)
morrica commentedon May 12, 2020
@gargakshit, this issue has been fixed in the merged commit above. The fix has not yet been pushed to pub.dev, but you can depend on github code directly in your pubspec.yaml if necessary.
gargakshit commentedon May 13, 2020
Cool, I'll use the git version. Thanks for the timely response
Update json.hpp: v3.11.2(U) to v3.12.0(M)