gpt4 book ai didi

android - View.java 行 18891 android.view.View.onRestoreInstanceState 异常

转载 作者:行者123 更新时间:2023-11-29 23:23:37 25 4
gpt4 key购买 nike

我在 crashlytics 中遇到了一些异常。但无法找到异常的文件或原因。另外,我每次都得到不同的行号。

我没有太多信息,我正在寻找详细信息。

我从 crashlytics 获得设备详细信息,例如:

-- 三星 SM-G950F -- Android 8 -- View.java 第 18877 行,View.java 第 18891 行

-- Oppo R7plusf -- Android 5 -- View.java 13790 行

--华硕 ASUS_X00LD -- Android 8 -- View.java 行 17753

View.java 行 18891 android.view.View.onRestoreInstanceState

Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{com.lendlease.plus/com.lendlease.plus.activity.ReceiptDetailActivity}: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.os.Bundle instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/ivReceipt. Make sure other views do not use the same id.
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2955)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3030)
android.app.ActivityThread.-wrap11 (Unknown Source)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1696)
android.os.Handler.dispatchMessage (Handler.java:105)
android.os.Looper.loop (Looper.java:164)
android.app.ActivityThread.main (ActivityThread.java:6938)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

如果您遇到此类异常,请告诉我,或者您可能知道造成这种情况的任何原因。

谢谢!

最佳答案

你读过崩溃报告了吗

expecting View State but received class android.os.Bundle instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/ivReceipt. Make sure other views do not use the same id. android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2955)

报告说在你的 ReceiptDetailActivity 布局中你有两个不同的 View 包含相同的 id ivReceipt

根据您的以下评论

Yes in that layout there is one included layout which contains same ivReceipt id

解决方案 不要使用相同的 ID 只需更改 id 名称即可

关于android - View.java 行 18891 android.view.View.onRestoreInstanceState 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53862673/

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