Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
peter100u opened this issue Dec 21, 2023 · 3 comments

Comments

@peter100u
Copy link

  • 系统版本(必须)/ 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)打印,就出现了这个错误,目前测试只有这个手机出现,其他都是正常

@peter100u
Copy link
Author

大佬,还维护吗。。。

@peter100u
Copy link
Author

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

@razerdp
Copy link
Owner

razerdp commented Jan 4, 2024

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

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

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

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

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

No branches or pull requests

2 participants