Skip to content
This repository was archived by the owner on Feb 3, 2020. It is now read-only.

FloatingViewManager.removeAllViewToWindow() causes IllegalArgumentException #89

Closed
geecko86 opened this issue Jul 13, 2018 · 1 comment
Labels

Comments

@geecko86
Copy link
Contributor

geecko86 commented Jul 13, 2018

I'm Here's the stacktrace.

java.lang.IllegalArgumentException: View=jp.co.recruit_lifestyle.android.floatingview.a{2d7e2db VFE...C.. ......ID 0,0-216,216} not attached to window manager

Caused By:
android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:509)
android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java:399)
android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:123)
jp.co.recruit_lifestyle.android.floatingview.FloatingViewManager.removeAllViewToWindow (SourceFile:550)
com.geecko.QuickLyric.services.LyricsOverlayService.onStartCommand (SourceFile:278)
android.app.ActivityThread.handleServiceArgs (ActivityThread.java:3639)
android.app.ActivityThread.-wrap20 (Unknown Source)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1768)
android.os.Handler.dispatchMessage (Handler.java:108)
android.os.Looper.loop (Looper.java:206)
android.app.ActivityThread.main (ActivityThread.java:6749)
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)

Have gotten several thousands crash reports like this in the past 30 days.
The Library version that's used here is 2.3.1.
Important to note it only happens with Android 8.

Perhaps you need to use ViewCompat.isAttachedToWindow()?

@dbof10
Copy link

dbof10 commented Jan 4, 2019

I think adding ViewCompat.isAttachedToWindow() is also a bug too. My view is still there when the service is destroyed. I have to

 val windowManager = getSystemService(WINDOW_SERVICE) as WindowManager
        try {
            windowManager.removeView(contextView!!.rootView)
        } catch (e: Exception) {
            Log.e(TAG, "Bubble remove view error " + e.message)
        }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants