Closed Bug 1306490 Opened 3 years ago Closed 3 years ago

Blank (white) content for all web pages in latest version of Android emulator

Categories

(Firefox Build System :: Android Studio and Gradle Integration, defect)

defect
Not set

Tracking

(firefox52 fixed)

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(2 files)

As noted in https://bugzilla.mozilla.org/show_bug.cgi?id=1303008#c4, we are starting to see no content in web pages when run on the Android emulator. That case seems to be running the emulator from Android Studio on OSX. I see the same problem with 'mach android-emulator' on Ubuntu 16.

This seems to affect old Fennec (~49.0) builds as well, even though we just started noticing this. Explanation: The Android emulator changed. 

If I downgrade my emulator to the one distributed with the 24.0.2 sdk, the problem disappears and pages are rendered correctly.
See Also: → 1303008
As I mentioned in Bug 1303008, I can get around this (running on Fedora 24) by disabling graphics hardware rendering in emulator's settings (via the AVD Manager). With Software-backed rendering (in avd manager's lingo), things seem to run well enough, albeit none-insignificantly slower.
Thanks. And to use the 4.3 avd set up with 'mach android-emulator', it is possible to use:

$ export ANDROID_AVD_HOME=~/.mozbuild/android-device/avd
$ emulator -gpu swiftshader -avd mozemulator-4.3
Assignee: nobody → gbrown
Adding '-gpu swiftshader' seems necessary to avoid this problem when running firefox in a new emulator. Older versions of the emulator may complain or even fail with the new option, but I don't have an easy way of checking for compatibility, I expect anyone building firefox for android will have been auto-upgraded to a new emulator, and it is easy to resolve any compatibility problems by simply updating the sdk/emulator.
Attachment #8799906 - Flags: review?(jmaher)
Comment on attachment 8799906 [details] [diff] [review]
use '-gpu swiftshader' when starting emulator from mach

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

any concerns with in automation vs locally (i.e. mach)?
Attachment #8799906 - Flags: review?(jmaher) → review+
Tests run from mozharness will continue to use the old emulator and will not use the new option. As long as the sdk/emulator used for local builds is a moving target, I think there will always be a difference between automation and mach. Thankfully, it seems there is not much functional difference between emulator versions.
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9199fb5b105b
Use '-gpu swiftshader' when starting android emulator from mach; r=jmaher
https://hg.mozilla.org/mozilla-central/rev/9199fb5b105b
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
FYI for me this broke the emulator: I get this in emulator.log:

<ERROR: Invalid GPU mode 'swiftshader', use one of: on off host guest mesa>

I'm on Ubuntu 14.04.5 LTS if that makes any difference.
Sorry about that!

The issue is that your emulator is too old. An update of your Android sdk should make it work -- running 'mach bootstrap' should do the trick.
(In reply to Geoff Brown [:gbrown] from comment #9)
> The issue is that your emulator is too old. An update of your Android sdk
> should make it work -- running 'mach bootstrap' should do the trick.

Tried 'mach bootstrap', now I'm running into bug 1307314. :/
Attached file emulator.log
After working around bug 1307314, I did a clean build and the emulator still fails to start up. I'm attaching the emulator.log output.
For some reason, kats was stuck on Android SDK Tool 24.0.1. He manually updated to Android SDK Tools 25.2.2 and updated his avd with 'mach android-emulator --force-update' -- and the emulator is working for him now.
For the record, I did a clean clone/mach bootstrap and ran into exactly the same problem in comment 8. Is mach bootstrap installing the right version of the emulator?
Ah - interesting twist. I was attempting to use artifact builds, but I needed to do a full build, so I re-ran mach bootstrap with a non-artifact setup, and it seems to have installed the most recent emulator.
Oh, no, I lied. It didn't. (Sorry for the bugspam.)
Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 52 → mozilla52
You need to log in before you can comment on or make changes to this bug.