Commit 732b848
Error: android_crash:java.lang.IllegalArgumentException:com.facebook.react.views.view.WindowUtilKt.s (facebook#57056)
Summary:
Pull Request resolved: facebook#57056
Fixed the crash (IllegalArgumentException: View not attached to window manager in `StatusBarModule`). The root cause is a lifecycle race condition where `StatusBarModule.setHidden()` and `setStyle()` post runnables to the UI thread that modify window attributes, but the activity can be destroyed before the runnable executes. Added `activity.isFinishing || activity.isDestroyed` guard checks inside both UI thread runnables in `StatusBarModule.kt` to prevent modifying window attributes on a destroyed activity.
Changelog: [Android][Fixed] - Prevent `IllegalArgumentException` crash in `StatusBarModule` when activity is destroyed before the UI thread runnable executes
Reviewed By: javache, cortinico
Differential Revision: D106202618
fbshipit-source-id: dc8eaf5698f19cb0192f1d115618ae0f8b2c472b1 parent cb74b82 commit 732b848
1 file changed
Lines changed: 2 additions & 0 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
0 commit comments