微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

崩溃报告中数组的索引号和大小信息是否与原始代码相同?

如何解决崩溃报告中数组的索引号和大小信息是否与原始代码相同?

在我的android应用中,我正在使用以下proguard规则。

-keepattributes SourceFile,LineNumberTable

-renamesourcefileattribute SourceFile

以下是错误报告摘要,但未提及正确的行号和类名。该报告中提到的索引编号和大小应该与原始索引相同还是要更改?

java.lang.indexoutofboundsexception: Index: 11,Size: 10
at java.util.ArrayList.get(ArrayList.java:437)
at c.b.a.F.b(SourceFile:21)
at androidx.recyclerview.widget.RecyclerView$a.a(SourceFile:14)
at androidx.recyclerview.widget.RecyclerView$p.a(SourceFile:157)
at androidx.recyclerview.widget.linearlayoutmanager$c.a(SourceFile:10)
at androidx.recyclerview.widget.linearlayoutmanager.a(SourceFile:108)
at androidx.recyclerview.widget.linearlayoutmanager.a(SourceFile:95)
at androidx.recyclerview.widget.linearlayoutmanager.e(SourceFile:119)
at androidx.recyclerview.widget.RecyclerView.f(SourceFile:8)
at androidx.recyclerview.widget.RecyclerView.d(SourceFile:9)
at androidx.recyclerview.widget.RecyclerView.onLayout(SourceFile:2)
at android.view.View.layout(View.java:20710)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at androidx.constraintlayout.widget.ConstraintLayout.onLayout(SourceFile:12)
at android.view.View.layout(View.java:20710)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20710)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:20710)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:20710)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
at android.view.View.layout(View.java:20710)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:757)
at android.view.View.layout(View.java:20710)
at android.view.ViewGroup.layout(ViewGroup.java:6198)
at android.view.ViewRootImpl.performlayout(ViewRootImpl.java:2839)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2366)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1505)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7353)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1100)
at android.view.Choreographer.doCallbacks(Choreographer.java:895)
at android.view.Choreographer.doFrame(Choreographer.java:826)
at android.view.Choreographer$FramedisplayEventReceiver.run(Choreographer.java:1086)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6864)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

解决方法

此异常在删除对数组的第11个索引的调用后已被删除,因此原始问题的答案是肯定的,崩溃报告中数组的索引号和大小信息与原始代码相同。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。