Skip to content

Error: android_crash:java.lang.IllegalArgumentException:com.facebook.react.views.view.WindowUtilKt.s (#57056)#57056

Closed
alanleedev wants to merge 1 commit into
facebook:mainfrom
alanleedev:export-D106202618
Closed

Error: android_crash:java.lang.IllegalArgumentException:com.facebook.react.views.view.WindowUtilKt.s (#57056)#57056
alanleedev wants to merge 1 commit into
facebook:mainfrom
alanleedev:export-D106202618

Conversation

@alanleedev
Copy link
Copy Markdown
Contributor

@alanleedev alanleedev commented Jun 3, 2026

Summary:

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 3, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 3, 2026

@alanleedev has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106202618.

Copy link
Copy Markdown
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot changed the title Error: android_crash:java.lang.IllegalArgumentException:com.facebook.react.views.view.WindowUtilKt.s Error: android_crash:java.lang.IllegalArgumentException:com.facebook.react.views.view.WindowUtilKt.s (#57056) Jun 3, 2026
alanleedev added a commit to alanleedev/react-native that referenced this pull request Jun 3, 2026
…react.views.view.WindowUtilKt.s (facebook#57056)

Summary:

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: cortinico

Differential Revision: D106202618
@alanleedev alanleedev force-pushed the export-D106202618 branch from 8e9f867 to 5676d65 Compare June 3, 2026 07:20
alanleedev added a commit to alanleedev/react-native that referenced this pull request Jun 3, 2026
…react.views.view.WindowUtilKt.s (facebook#57056)

Summary:

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: cortinico

Differential Revision: D106202618
@alanleedev alanleedev force-pushed the export-D106202618 branch from 5676d65 to a4b0885 Compare June 3, 2026 07:22
alanleedev added a commit to alanleedev/react-native that referenced this pull request Jun 3, 2026
…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
@alanleedev alanleedev force-pushed the export-D106202618 branch from a4b0885 to a86d56a Compare June 3, 2026 18:37
…react.views.view.WindowUtilKt.s (facebook#57056)

Summary:

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
@alanleedev alanleedev force-pushed the export-D106202618 branch from a86d56a to f156e3c Compare June 3, 2026 18:39
@meta-codesync meta-codesync Bot closed this in 732b848 Jun 3, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @alanleedev in 732b848

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants