razerdp/BasePopup

java.lang.ClassCastException: razerdp.basepopup.WindowManagerProxy cannot be cast to android.view.WindowManagerImpl

peter100u opened this issue · 3 comments

  • 系统版本(必须)/ Realme C53 Android 13
  • 库版本(必须)/ 3.2.1
  • 问题代码/截图(可选)/ 调用showPopupWindow()无法展示,其他手机都是正常,只有上面的手机
  • 报错信息(可选)/ Error reporting information (optional):
    java.lang.ClassCastException: razerdp.basepopup.WindowManagerProxy cannot be cast to android.view.WindowManagerImpl
    at android.view.ViewRootImpl.(ViewRootImpl.java:983)
    at android.view.ViewRootImpl.(ViewRootImpl.java:900)
    at android.view.UnisocViewRootImpl.(UnisocViewRootImpl.java:31)
    at android.view.UnisocViewRootImplFactory.makeViewRootImpl(UnisocViewRootImplFactory.java:15)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:389)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:221)
    at razerdp.basepopup.WindowManagerProxy.addView(WindowManagerProxy.java:105)
    at android.widget.PopupWindow.invokePopup(PopupWindow.java:1581)
    at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1347)
    at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1313)
    at razerdp.basepopup.PopupWindowProxy.showAtLocation(PopupWindowProxy.java:88)
    at razerdp.basepopup.BasePopupWindow.tryToShowPopup(BasePopupWindow.java:863)
    at razerdp.basepopup.BasePopupWindow.showPopupWindow(BasePopupWindow.java:692)
    at com.inyuapp.mobile.speech2.widget.navbar.QuitRoomPopupWindow.showPopupWindow(QuitRoomPopupWindow.kt:77)

问题描述/重现步骤请写在这里
操作很简单,就是调用showPopupWindow(), 无法展示, 也没有crash, 然后我在onShowError(e)打印,就出现了这个错误,目前测试只有这个手机出现,其他都是正常

大佬,还维护吗。。。

RMX3830, RMX3760, 目前都是这个realme系列的手机出现问题

在维护的,只是我工作忙,每天进度一点点。。。

你这个问题似乎是系统ROM导致

定位代码:
at android.view.UnisocViewRootImpl.(UnisocViewRootImpl.java:31)
at android.view.UnisocViewRootImplFactory.makeViewRootImpl(UnisocViewRootImplFactory.java:15)

弹窗库的WindowManagerProxy 继承的是其更上一层WindowManager,ROM底层代码修改过,factory会创建impl,这就相当于一个父类强转为子类,这是不行的。