Closed Bug 1134338 Opened 9 years ago Closed 9 years ago

crash in java.lang.NullPointerException: Attempt to invoke virtual method ''android.view.View android.view.ViewStub.inflate()'' on a null object reference at org.mozilla.gecko.GeckoApp.onWindowFocusChanged(GeckoApp.java)

Categories

(Firefox for Android Graveyard :: Web Apps (PWAs), defect)

38 Branch
ARM
Android
defect
Not set
critical

Tracking

(firefox37 ?, firefox38 fixed, fennec37+)

RESOLVED FIXED
Firefox 38
Tracking Status
firefox37 --- ?
firefox38 --- fixed
fennec 37+ ---

People

(Reporter: aaronmt, Assigned: domivinc)

References

(Blocks 1 open bug)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file, 1 obsolete file)

[Tracking Requested - why for this release]:

This bug was filed from the Socorro interface and is 
report bp-9efaf518-113b-44ca-9a0f-3b9e62150218.
=============================================================

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.ViewStub.inflate()' on a null object reference
	at org.mozilla.gecko.GeckoApp.onWindowFocusChanged(GeckoApp.java:1934)
	at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:3064)
	at android.view.View.dispatchWindowFocusChanged(View.java:8592)
	at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1160)
	at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3192)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5221)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

Web-apps are currently crashing on launch on trunk. I get this after launching Outlook after installing it on the Marketplace on my Nexus 6 (Nightly 02/18).
Can anyone else reproduce?
I get a range of https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=09f4968d5f42&tochange=9696d1c4b3ba but I don't know if it's my device playing tricks on me. Anything stand out?
This appeared on fx-team Autophone tests for 

https://treeherder.mozilla.org/#/jobs?repo=fx-team&revision=9d7cc5a9570f&exclusion_state=all&filter-searchStr=autophone

9d7cc5a9570f SJ bug 1133030 - Fix timeout in browser_webconsole_bug_632817.js by requesting a page with valid CORS headers. r=past

ec8bf5a601ef dv bug 1130630 - Move zoomed_view_stub from shared_ui_components to gecko_app. r=mcomella

306eab8d8ffe JO bug 1126274 - Add new API to listen for sent and received RDP packets. r=jryans

e1d276c611ea SJ bug 1125526 - Wait for output from executed method in browser_webconsole_assert.js before asserting on number of messages. r=past

d547c062e79a AP bug 1124501 - Add a "logs" panel to WebIDE showing pre-package command output. r=jryans
Thinking bug 1130630 is the culprit.
Blocks: 1130630
(In reply to Aaron Train [:aaronmt] from comment #4)
> Thinking bug 1130630 is the culprit.

I agree. Dominique, can you take a look?

The issue here is that GeckoApp.java is used by both web apps and the browser, while @layout/gecko_app is used by just the browser and @layout/web_app is used by web apps. Therefore, in GeckoApp we're referencing some null views. We probably want to move the inflation to BrowserApp as a solution.
Assignee: nobody → domivinc
Status: NEW → ASSIGNED
Can we back bug 1130630 out fix the issue there? This is breaking Autophone's webappstartup testing.
(In reply to Michael Comella (:mcomella) from comment #5)
> (In reply to Aaron Train [:aaronmt] from comment #4)
> > Thinking bug 1130630 is the culprit.
> 
> I agree. Dominique, can you take a look?
> 
> The issue here is that GeckoApp.java is used by both web apps and the
> browser, while @layout/gecko_app is used by just the browser and
> @layout/web_app is used by web apps. Therefore, in GeckoApp we're
> referencing some null views. We probably want to move the inflation to
> BrowserApp as a solution.

I'm going to move the inflate call in BrowserApp.
Same changes but with a code rebase.
Attachment #8566838 - Attachment is obsolete: true
Attachment #8566838 - Flags: review?(michael.l.comella)
Attachment #8566840 - Flags: review?(michael.l.comella)
Michael, do you know the tests I could include in the following try command in order to also test the web apps?

try: -b do -p android-api-9,android-api-11,android-x86 -u robocop-1,robocop-2,robocop-3,robocop-4,robocop-5 -t none
Flags: needinfo?(michael.l.comella)
I don't think robocop will test web apps. You can use 

try: -b o -p android-api-9,android-api-11 -u autophone-webapp -t none

See https://wiki.mozilla.org/Auto-tools/Projects/AutoPhone/Autophone_for_developers#Submitting_try_builds_to_Autophone
(In reply to Bob Clary [:bc:] from comment #11)
> I don't think robocop will test web apps. You can use 
> 
> try: -b o -p android-api-9,android-api-11 -u autophone-webapp -t none
> 
> See
> https://wiki.mozilla.org/Auto-tools/Projects/AutoPhone/
> Autophone_for_developers#Submitting_try_builds_to_Autophone

Thanks! I added the "autophone-webapp" to the try command.
Flags: needinfo?(michael.l.comella)
Comment on attachment 8566840 [details] [diff] [review]
patch2-20022015 1-Bug_1134338___Move_ZoomedView_inflate_in_BrowserApp.patch

Review of attachment 8566840 [details] [diff] [review]:
-----------------------------------------------------------------

Note: This changes the ZoomedView inflation to occur sooner, in BrowserApp.onCreate (as opposed to GeckoApp.initialize). Just a thought that we might want to do this in BrowserApp.initializeChrome instead for startup perf reasons, but I noticed that the tablet tab strip is also inflated in onCreate so I don't think it's a vital change.

Richard, any thoughts?

r+ w/ green try. If this causes regressions, feel free to back this, and the dependent bug, out.
Attachment #8566840 - Flags: review?(michael.l.comella) → review+
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a74cbd6ab9bf&exclusion_state=all

The orange on the Android 2.3 A(w) is a known issue. The run is green from my perspective.
Comment on attachment 8566840 [details] [diff] [review]
patch2-20022015 1-Bug_1134338___Move_ZoomedView_inflate_in_BrowserApp.patch

Review of attachment 8566840 [details] [diff] [review]:
-----------------------------------------------------------------

It's true that we do a lot of work (maybe too much) in onCreate. That this is a ViewStub in the first place implies that it's meant to be lazily inflated. 

Why are we bothering with using a ViewStub at all if we're going to inflate it during onCreate?

Is it so that we can pref it off?
Keywords: checkin-needed
(In reply to Richard Newman [:rnewman] from comment #16)
> Comment on attachment 8566840 [details] [diff] [review]
> patch2-20022015 1-Bug_1134338___Move_ZoomedView_inflate_in_BrowserApp.patch
> 
> Why are we bothering with using a ViewStub at all if we're going to inflate
> it during onCreate?
> 
> Is it so that we can pref it off?

The full story about the inflate of the zoomedView is in bug 1117796. The original implementation didn't use "inflate" call.
Currently there are 2 flags regarding the zoomedView functionality:
- by default, only the nightly builds can use it,
- pref "ui.zoomedview.enabled" to switch On/Off the zoomedView (Off by default).
https://hg.mozilla.org/mozilla-central/rev/1e087e6607f1
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 38
tracking-fennec: ? → 37+
Flags: needinfo?(rnewman)
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: