Opened on 04/11/2017 at 03:46:13 PM

Closed on 04/28/2017 at 02:57:26 PM

Last modified on 07/05/2017 at 08:56:39 AM

#5129 closed defect (fixed)

[build] Signing fails if zipalign is not in PATH

Reported by: fhd Assignee: diegocarloslima
Priority: P2 Milestone: Adblock-Browser-for-Android-1.2.0
Module: Adblock-Browser-for-Android Keywords:
Cc: diegocarloslima Blocked By:
Blocking: Platform: Adblock Browser for Android
Ready: yes Confidential: no
Tester: Scheer Verified working: yes
Review URL(s):



Ubuntu 16.04, adblockbrowser-build revision bb6d66b3c073.

How to reproduce

  1. Run ./ build.
  2. Run ./ sign PATH where PATH is the location of the APK generated by the previous step.

Observed behaviour exits with an error. The last few lines of the output:

jar signed.

No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2112-07-20) or after any future revocation date.
Traceback (most recent call last):
  File "./", line 163, in <module>
    _sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME)
  File "./", line 115, in _sign
    subprocess.check_call(["zipalign", "-v", "4", temp_apk_path, apk_path])
  File "/usr/lib/python2.7/", line 536, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/", line 523, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Expected behaviour

The APK should be signed and should exit without errors.

Attachments (0)

Change History (9)

comment:1 Changed on 04/11/2017 at 03:46:24 PM by fhd

  • Owner set to fhd

comment:2 Changed on 04/11/2017 at 04:18:16 PM by fhd

I've removed the warning by supplying the -tsa argument, but the build still fails. Investigating.

comment:3 Changed on 04/11/2017 at 04:49:56 PM by fhd

  • Summary changed from [build] Signing fails due to jarsigner warning to [build] Signing fails if zipalign is not in PATH

Turns out, jarsigner isn't actually the culprit - zipalign is. I just didn't have the executable in my PATH.

I figure we have two options:

1) We make check that zipalign is in PATH before it begins the signing process.
2) We don't expect zipalign in the PATH to begin with.

I'm leaning towards (2) - even if that means hard coding the build tools version (it's zipalign's path). The alternative is to manually ensure the correct version of zipalign is in PATH on each system, seems error prone.

Diego, what do you think?

comment:4 Changed on 04/24/2017 at 11:26:45 AM by diegocarloslima

  • Owner changed from fhd to diegocarloslima
  • Platform changed from Unknown / Cross platform to Adblock Browser for Android

comment:5 Changed on 04/24/2017 at 11:29:27 AM by diegocarloslima

Yeah, approach 2 seems a better way of solving this. There's a ANDROID_BUILD_TOOLS_VERSION in Mozilla's code which we can use in order to get the path for the zipalign tool

comment:6 Changed on 04/24/2017 at 11:30:23 AM by diegocarloslima

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:7 Changed on 04/28/2017 at 02:55:02 PM by abpbot

A commit referencing this issue has landed:
Issue 5129 - [build Signing fails if zipalign is not in PATH]

comment:8 Changed on 04/28/2017 at 02:57:26 PM by diegocarloslima

  • Milestone set to Adblock-Browser-for-Android-next
  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:9 Changed on 07/05/2017 at 08:56:39 AM by scheer

  • Tester changed from Unknown to Scheer
  • Verified working set

Galaxy S7
Android 7.0

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from diegocarloslima.
Note: See TracTickets for help on using tickets.