Flutter线程模型

摘要

Flutter Engine层面,有四个Runner各司其职,这里的Runner其实就是线程,不过这四个Runner是由Engine和Native之间的那个嵌入层(Embedder)去赋值的,Engine层只会使用这四个Runner,不会创建新的线程。

阅读更多

常见的PopupWindow Crash:xxx not attached to window manager 问题分析到修复之路

摘要

随着项目新版本发出去,又开始频繁出现PopupWindow$PopupDecorView not attached to window manager问题,通过firebase上我们自己上传的日志看到大部分crash在商品详情页,具体堆栈信息如下:

1
2
3
4
5
6
7
8
9
Fatal Exception: java.lang.IllegalArgumentException
View=android.widget.PopupWindow$PopupDecorView{cc692ff V.E...... ......I. 0,0-0,0} not attached to window manager
android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:424)
android.view.WindowManagerGlobal.updateViewLayout (WindowManagerGlobal.java:336)
android.view.WindowManagerImpl.updateViewLayout (WindowManagerImpl.java:93)
android.widget.PopupWindow.update (PopupWindow.java:1816)
android.widget.PopupWindow$1.onScrollChanged (PopupWindow.java:174)
android.view.ViewTreeObserver.dispatchOnScrollChanged (ViewTreeObserver.java:1016)
...

阅读更多

记一次踩坑:onSaveInstanceState & onRestoreInstanceState过程分析

摘要

app灰度中,发现如下crash一枚。而且全部集中在Android 4.0和5.0的手机上。

1
2
Caused by java.lang.IllegalArgumentException
Wrong state class, expecting View State but received class android.widget.HorizontalScrollView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/0x0. Make sure other views do not use the same id.

阅读更多