gpt4 book ai didi

android.view.AbsSavedState$1 无法转换为 android.widget.CompoundButton$SavedState

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:02:34 30 4
gpt4 key购买 nike

我在 Crashlytics 上经常看到以下错误:

Caused by java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState
at android.widget.CompoundButton.onRestoreInstanceState(CompoundButton.java)
at android.view.View.dispatchRestoreInstanceState(View.java)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java)
at android.view.View.restoreHierarchyState(View.java)
at android.support.v4.app.Fragment.restoreViewState(Fragment.java:494)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1486)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:2466)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1483)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3229)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:620)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java)
at android.app.Activity.performStart(Activity.java)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java)
at android.app.ActivityThread.access$900(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java)
at android.os.Handler.dispatchMessage(Handler.java)
at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

但是这个堆栈跟踪没有说明我的代码库,因为异常是在平台级别抛出的。

根据我的阅读,这可能与重复的 ID 有关,但我在我的代码中找不到任何关于如何调试它的想法?

我还尝试在开发人员选项中启用“不保留 Activity ”以强制实例恢复,但我无法手动重现崩溃。

最佳答案

在没有看到代码和确切的 Activity/fragment 类的情况下,很难找到确切的问题,但可能有以下原因可以帮助您进行更多调试..

  1. 在转换时,您的 id 或 View 可能会匹配并造成内存泄漏。

  2. CompoundButton 的导入可能有误,可能是您使用的是自定义 View 或版本影响。

关于android.view.AbsSavedState$1 无法转换为 android.widget.CompoundButton$SavedState,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52591826/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com