"./mach android-emulator --force-update" is broken on Windows

RESOLVED FIXED in Firefox 48

Status

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Dexter, Assigned: gbrown)

Tracking

Trunk
mozilla48
Unspecified
Windows
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

Attachments

(1 attachment)

Reporter

Description

3 years ago
It looks like --force-update fails to update the AVD on Windows.

$ ./mach android-emulator --force-update
 0:00.93 Fetching and installing AVD. This may take a few minutes...
Error running mach:

    ['android-emulator', '--force-update']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

WindowsError: [Error 183] Impossibile creare un file, se il file esiste gi

  File "c:\mozilla-central\mobile/android/mach_commands.py", line 140, in emulator
    emulator.update_avd(force_update)
  File "c:\mozilla-central\testing/mozbase/mozrunner\mozrunner\devices\android_device.py", line 363, in update_avd
    self._update_avd_paths()
  File "c:\mozilla-central\testing/mozbase/mozrunner\mozrunner\devices\android_device.py", line 462, in _update_avd_paths

"WindowsError: [Error 183] Impossibile creare un file, se il file esiste gi" roughtly translates to "Unable to create a file, if it exists already".
Assignee

Updated

3 years ago
Assignee: nobody → gbrown
Assignee

Comment 1

3 years ago
I think this could happen on any platform. With --force-update, mach deletes the avd directory, but not the ini file, so the ini file may exist when mach tries to replace it. This patch deletes the ini file once the avd directory is gone and before trying to update.

:Dexter -- Does this fix it for you?
Attachment #8741407 - Flags: review?(jmaher)
Attachment #8741407 - Flags: feedback?(alessio.placitelli)
Comment on attachment 8741407 [details] [diff] [review]
remove ini file before updating

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

good stuff!
Attachment #8741407 - Flags: review?(jmaher) → review+
Reporter

Comment 3

3 years ago
Comment on attachment 8741407 [details] [diff] [review]
remove ini file before updating

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

Super, works like a charm.
Attachment #8741407 - Flags: feedback?(alessio.placitelli) → feedback+

Comment 5

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b4b843abf463
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.