Grey screen of death when opening backgrounded Nightly: IllegalArgumentException: Wrong state class, expecting View State but received class android.support.v4.view.ViewPager$SavedState instead

RESOLVED DUPLICATE of bug 912298

Status

()

Firefox for Android
Awesomescreen
--
blocker
RESOLVED DUPLICATE of bug 912298
4 years ago
2 years ago

People

(Reporter: rnewman, Unassigned)

Tracking

Trunk
All
Android
Points:
---

Firefox Tracking Flags

(firefox26 affected)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 798196 [details]
Log

This has been interrupting my experience since probably the Fig merge. Sometimes, I'll tap a link in Twitter or Facebook, and Nightly will just stall at the grey background for the home screen. I have to open Settings and kill the app.

Here's why:

D/GeckoSessInfo(28062): Building SessionInformation from prefs: 0, 0, true, false
D/GeckoProfile(28062): Found profile dir: /data/data/org.mozilla.fennec/files/mozilla/c2kcd0q0.default
I/GeckoApp(28062): Creating BrowserHealthRecorder.
D/GeckoHealthRec(28062): Initializing. Dispatcher is org.mozilla.gecko.util.EventDispatcher@41d21728
D/GeckoHealthRec(28062): Initializing profile cache.
I/GeckoLogger(28062): fennec :: GeckoProfileInfo :: Restoring ProfileInformationCache from file.
D/GeckoHealthRec(28062): Successfully restored state. Initializing storage.
D/GeckoHealthRec(28062): Done initializing profile cache. Beginning storage init.
E/GeckoAppShell(28062): >>> REPORTING UNCAUGHT EXCEPTION FROM THREAD 1 ("main")
E/GeckoAppShell(28062): java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.support.v4.view.ViewPager$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/home_pager. Make sure other views do not use the same id.
E/GeckoAppShell(28062): 	at android.view.View.onRestoreInstanceState(View.java:12076)
E/GeckoAppShell(28062): 	at android.view.View.dispatchRestoreInstanceState(View.java:12052)
E/GeckoAppShell(28062): 	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2601)
E/GeckoAppShell(28062): 	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2601)
E/GeckoAppShell(28062): 	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2601)
E/GeckoAppShell(28062): 	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2601)
E/GeckoAppShell(28062): 	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2601)
E/GeckoAppShell(28062): 	at android.view.View.restoreHierarchyState(View.java:12030)
E/GeckoAppShell(28062): 	at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1729)
E/GeckoAppShell(28062): 	at android.app.Activity.onRestoreInstanceState(Activity.java:957)
E/GeckoAppShell(28062): 	at android.app.Activity.performRestoreInstanceState(Activity.java:929)
E/GeckoAppShell(28062): 	at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1164)
E/GeckoAppShell(28062): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2310)
E/GeckoAppShell(28062): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2368)
E/GeckoAppShell(28062): 	at android.app.ActivityThread.access$600(ActivityThread.java:151)
E/GeckoAppShell(28062): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1330)
E/GeckoAppShell(28062): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/GeckoAppShell(28062): 	at android.os.Looper.loop(Looper.java:155)
E/GeckoAppShell(28062): 	at android.app.ActivityThread.main(ActivityThread.java:5536)
E/GeckoAppShell(28062): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/GeckoAppShell(28062): 	at java.lang.reflect.Method.invoke(Method.java:511)
E/GeckoAppShell(28062): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1074)
E/GeckoAppShell(28062): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:841)
E/GeckoAppShell(28062): 	at dalvik.system.NativeStart.main(Native Method)
(Reporter)

Comment 1

4 years ago
Wait a while, and you'll get an ANR from this, sometimes.

Repro with 0 background processes allowed, and doing a bit of stuff on your phone.
(Reporter)

Updated

4 years ago
tracking-fennec: --- → ?
status-firefox26: --- → affected
(Reporter)

Comment 2

4 years ago
Possibly relevant:

---
For those arriving here because this isn't working when using Fragments with the v4 support library, I note that the support library doesn't seem to call the View's onSaveInstanceState/onRestoreInstanceState for you; you have to explicitly call it yourself from a convenient place in the FragmentActivity or Fragment. 
---

http://stackoverflow.com/questions/3542333/how-to-prevent-custom-views-from-losing-state-across-screen-orientation-changes/3542895#3542895

Updated

4 years ago
Blocks: 862793
(Reporter)

Comment 3

4 years ago
N.B.:

* This also happens from the launcher. Correcting summary.
* Real-world failures do not trigger an ANR dialog. The user has to manually kill the app, and we have no record of the failure outside of FHR's own orphan session detection.

Marking as blocker, 'cos I'd block ship for this. I work on the product, and I'm planning to downgrade.
Severity: major → blocker
Summary: Grey screen of death when opening link in background Nightly: IllegalArgumentException: Wrong state class, expecting View State but received class android.support.v4.view.ViewPager$SavedState instead → Grey screen of death when opening backgrounded Nightly: IllegalArgumentException: Wrong state class, expecting View State but received class android.support.v4.view.ViewPager$SavedState instead

Updated

4 years ago
Keywords: steps-wanted
(Reporter)

Comment 4

4 years ago
Best steps I can give you:

* Use Nightly.
* Go do something else for a few hours.
* Click a link in another app.
* Observe grey screen.
* Force-quit Nightly.
* Click link again.
* Observe successful load.

This'll probably be solved by code reading.

Updated

4 years ago
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 912298
tracking-fennec: ? → ---
Keywords: steps-wanted
You need to log in before you can comment on or make changes to this bug.