Open Bug 1374585 Opened 3 years ago Updated 1 year ago

Crash in java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to org.mozilla.gecko.home.TwoLinePageRow at org.mozilla.gecko.home.CombinedHistoryRecyclerView.onItemClicked(CombinedHistoryRecyclerView.java)

Categories

(Firefox for Android :: Awesomescreen, defect, P3, critical)

54 Branch
All
Android
defect

Tracking

()

Tracking Status
firefox54 --- affected
firefox55 --- affected
firefox56 --- affected
firefox59 --- affected
firefox60 --- affected
firefox61 --- affected

People

(Reporter: gchang, Unassigned)

References

Details

(Keywords: crash)

Crash Data

This bug was filed from the Socorro interface and is 
report bp-494bb9d8-c76b-43c7-9b03-573f30170619.
=============================================================
From java stack trace:
java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to org.mozilla.gecko.home.TwoLinePageRow
	at org.mozilla.gecko.home.CombinedHistoryRecyclerView.onItemClicked(CombinedHistoryRecyclerView.java:121)
	at org.mozilla.gecko.widget.RecyclerViewClickSupport$1.onClick(RecyclerViewClickSupport.java:27)
	at android.view.View.performClick(View.java:4466)
	at android.view.View$PerformClick.run(View.java:18542)
	at android.os.Handler.handleCallback(Handler.java:733)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:136)
	at android.app.ActivityThread.main(ActivityThread.java:5097)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:515)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
	at dalvik.system.NativeStart.main(Native Method)

We have a spike for this crash in firefox for android 54 in the last 3 days.
Duplicate of this bug: 1328988
Crash Signature: [@ java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to org.mozilla.gecko.home.TwoLinePageRow at org.mozilla.gecko.home.CombinedHistoryRecyclerView.onItemClicked(CombinedHistoryRecyclerView.java)] → [@ java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to org.mozilla.gecko.home.TwoLinePageRow at org.mozilla.gecko.home.CombinedHistoryRecyclerView.onItemClicked(CombinedHistoryRecyclerView.java)] [@ java.lang.ClassCastException: a…
The immediate cause seems to be that our combined history recycler view and the adapter that's powering it are somehow out of sync. We get a click on a position that according to our adapter should be a synced tab or history item (https://dxr.mozilla.org/mozilla-central/rev/416c3c8c4b3db9ba96a103ce7820c9a140a3051d/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryRecyclerView.java#91), so we try to cast it to a TwoLinePageRow. This then fails because the item that we received a click for was in fact something else (presumably the sync or recent tabs smart folder - compare https://dxr.mozilla.org/mozilla-central/rev/416c3c8c4b3db9ba96a103ce7820c9a140a3051d/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java#198 and https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/resources/layout/home_smartfolder.xml - the date section headers are a simple TextView).

I've no idea where exactly this error is cropping in, though and I also don't see any relevant changes to the CombinedHistory files that happened in 54.
Component: General → Awesomescreen
Hardware: Unspecified → All
[triage] Non top crasher.
Priority: -- → P3
There are 10 crashes in nightly 61, 47 in beta 60 and 748 in release 59.0.2.
Crash Signature: android.widget.LinearLayout cannot be cast to org.mozilla.gecko.home.TwoLinePageRow at org.mozilla.gecko.home.CombinedHistoryRecyclerView.onItemClicked$39d17d12(CombinedHistoryRecyclerView.java)] → android.widget.LinearLayout cannot be cast to org.mozilla.gecko.home.TwoLinePageRow at org.mozilla.gecko.home.CombinedHistoryRecyclerView.onItemClicked$39d17d12(CombinedHistoryRecyclerView.java)] [@ java.lang.ClassCastException: at org.mozilla.gecko.hom…
You need to log in before you can comment on or make changes to this bug.