Search code examples
androidionic-frameworkzipalign

Publishing Ionic app - Zipalign not working


I am trying to get my Ionic app published. However, when trying to zipalign the apk with the following command

/Users/bertcarremans/Library/Android/sdk/build-tools/23.0.3/zipalign zipalign -v 4 android-release-unsigned.apk chartly.apk

I get the message below:

Zip alignment utility 
Copyright (C) 2009 The Android Open Source Project

Usage: zipalign [-f] [-p] [-v] [-z] <align> infile.zip outfile.zip
   zipalign -c [-v] <align> infile.zip

  <align>: alignment in bytes, e.g. '4' provides 32-bit alignment
  -c: check alignment only (does not modify file)
  -f: overwrite existing outfile.zip
  -p: page align stored shared object files
  -v: verbose output
  -z: recompress using Zopfli

How can I make the zipalign tool to work? Thanks!


Solution

  • I found the solution.

    1. Copy the zipalign tool to the apk folder of your app. On my computer the zipalign tool was located in /Users/bertcarremans/Library/Android/23.0.3
    2. Then run the command ./zipalign -v 4 android-release-unsigned.apk chartly.apk