zipalign: command not found zipalign: command not found android android

zipalign: command not found


Solved!

  1. I copied zipalign file from my Library/Android/sdk/build-tools/21.1.2 into my Ionic project folder

  2. I add ./ in front of the zipalign command like this - ./zipalign -v 4 /Users/zulhilmizainudin/Desktop/kl-parking/platforms/android/build/outputs/apk/android-release-unsigned.apk android-release.apk

  3. Done. Now I get android-release.apk inside my Ionic project folder.

Thanks to Michael for the solution!


If you're using Windows, the right way is to add path to zipalign.exe as PATH environment variable.

  1. Finding where zipalign.exe is located in your PC, in my case this was

C:\Users\random-username\AppData\Local\Android\sdk1\build-tools\24.0.1

  1. Then add this location as one of the entries in your PATH environment variable.


To avoid specifying or navigating to your sdk/build-tools/* directories each time you intend to build release version, you can simply add the path to your environment variable.

$ sudo nano ~/.bash_profile

copy and paste the below:

export PATH=${PATH}:/Library/Android/sdk/build-tools/21.1.2

You can then save and exit:

control + o // to save to file
control + x // to close the file
$ source ~/.bash_profile

You can then run your zipalign command from your project CLI directory.