question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not attached to Window Manager

See original GitHub issue

Hey, from time to time I get the following error in our logs:

java.lang.IllegalArgumentException View=com.android.internal.policy.PhoneWindow$DecorView{ffbac5a V.E...... R.....I. 0,0-720,1280} not attached to window manager 
    WindowManagerGlobal.java:451 android.view.WindowManagerGlobal.findViewLocked
    WindowManagerGlobal.java:377 android.view.WindowManagerGlobal.removeView
    WindowManagerImpl.java:140 android.view.WindowManagerImpl.removeViewImmediate
    Dialog.java:701 android.app.Dialog.dismissDialog
    Dialog.java:684 android.app.Dialog.dismiss
    SplashScreen.java:58 com.cboy.rn.splashscreen.SplashScreen$2.run
    Handler.java:739 android.os.Handler.handleCallback
    Handler.java:95 android.os.Handler.dispatchMessage
    Looper.java:148 android.os.Looper.loop
    ActivityThread.java:7331 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    ZygoteInit.java:1230 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
    ZygoteInit.java:1120 com.android.internal.os.ZygoteInit.main

Android 6.0.1 / Samsung

Any idea how I could fix this issue?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:12
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
syntax-ecommented, Dec 15, 2018

I’m seeing something similar in my production crash reports from time to time.

org.devio.rn.splashscreen.SplashScreen$2.run
java.lang.IllegalArgumentException: View=DecorView@2592c44[] not attached to window manager

android.view.WindowManagerGlobal.findViewLocked WindowManagerGlobal.java:509
android.view.WindowManagerGlobal.removeView WindowManagerGlobal.java:399
android.view.WindowManagerImpl.removeViewImmediate WindowManagerImpl.java:123
android.app.Dialog.dismissDialog Dialog.java:381
android.app.Dialog.dismiss Dialog.java:360
org.devio.rn.splashscreen.SplashScreen$2.run SplashScreen.java:66
android.os.Handler.handleCallback Handler.java:869
android.os.Handler.dispatchMessage Handler.java:101
android.os.Looper.loop Looper.java:206
android.app.ActivityThread.main ActivityThread.java:6735
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.Zygote$MethodAndArgsCaller.run Zygote.java:240
com.android.internal.os.ZygoteInit.main ZygoteInit.java:845

Judging from telemetry, it appears to be happening at the time of calling SplashScreen.hide() within the react native part of the app. This likely leaves the user stuck on the splash screen until they force close the app.

So far it has exhibited itself on two devices:

  • WP2 - Android 8.0.0
  • P9 - Android 7.0
Environment:
  OS: macOS 10.14.1
  Node: 10.9.0
  Yarn: 1.9.4
  npm: 6.4.1
  Watchman: 4.9.0
  Xcode: Xcode 10.1 Build version 10B61
  Android Studio: 3.2 AI-181.5540.7.32.5056338

Packages: (wanted => installed)
  react: 16.0.0 => 16.0.0
  react-native: ^0.51.0 => 0.51.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

View not attached to window manager crash - Stack Overflow
This issue is because of your activity gets finished before the dismiss function gets called. Handle the exception and check your ADB log...
Read more >
View not attached to window manager crash - Android
Android App is getting crashed on dismissing idle timeout dialog occasionally. Any idea how to fix? Visualizer plugin version: 7.2.1.
Read more >
IllegalArgumentException - View not attached to window ...
java.lang.IllegalArgumentException : View=DecorView@861288[EditPostActivity] not attached to window manager at android.view.
Read more >
java.lang.IllegalArgumentException - Pinterest
IllegalArgumentException: View=DecorView@b5fcc9b[DrawingActivity ] not attached to window manager at android.view.WindowManagerGlobal.
Read more >
Android – View not attached to window manager crash
I was getting a View not attached to window manager error message and thought I had fixed it by wrapping the pDialog.dismiss(); in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found