AbsSavedState强转HorizontalScrollView$SavedState异常?

发布于 2022-09-02 15:37:09 字数 4823 浏览 9 评论 0

最近发现crash日志中出现大量android.view.AbsSavedState$1 cannot be cast to android.widget.HorizontalScrollView$SavedState。然而crash的堆栈中寻不到app的代码行,均未sdk下的,故到目前为止未能查到可能会导致该异常的代码点。而且在调试过程中发现,正常使用app基本不会导致该异常,只有在app遭遇其他异常crash之后才会出现该crash。

请问是否有人遇到过?


java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.HorizontalScrollView$SavedState

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2359)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2422)
at android.app.ActivityThread.access$800(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5327)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1124)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:808)

Caused by: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.HorizontalScrollView$SavedState

at android.widget.HorizontalScrollView.onRestoreInstanceState(HorizontalScrollView.java:1676)
at android.view.View.dispatchRestoreInstanceState(View.java:13812)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2888)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.View.restoreHierarchyState(View.java:13790)
at android.support.v4.app.Fragment.restoreViewState(Fragment.java)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManagerImpl.java)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236)
at android.app.Activity.performStart(Activity.java:6057)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2312)
... 10 more

java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.HorizontalScrollView$SavedState

at android.widget.HorizontalScrollView.onRestoreInstanceState(HorizontalScrollView.java:1676)
at android.view.View.dispatchRestoreInstanceState(View.java:13812)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2888)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2894)
at android.view.View.restoreHierarchyState(View.java:13790)
at android.support.v4.app.Fragment.restoreViewState(Fragment.java)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManagerImpl.java)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236)
at android.app.Activity.performStart(Activity.java:6057)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2312)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2422)
at android.app.ActivityThread.access$800(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5327)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1124)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:808)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文