cannot find zip-align when publishing app

118,140

Solution 1

I had the same problem. And to fix it, I copy the Zipalign file from sdk/build-tools/android-4.4W folder to sdk/tools/

Edited: Since Google updated SDK for Android, new build-tools does fix this problem. So I encouraged everyone to update to Android SDK Build-tools 20 as suggested by Pang in the post below.

Solution 2

I fixed it by installing Android SDK Build-tools 20:

In EclipsePull Down MenuWindowAndroid SDK Manager, check Android SDK Build-tools Rev. 20, then click the Install n package(s)… button to start installing.

Solution 3

It becomes usable if you install

Android SDK Build-tools Rev.20

Solution 4

Mac / Linux:

This worked for me (you might want to replace 22.0.1 with version of your build tools):

Edit: ~/.bashrc

export ANDROID_HOME=~/Android/Sdk/
export ANDROID_TOOLS=~/Android/Sdk/tools/
export ANDROID_BUILD_TOOLS=~/Android/Sdk/build-tools/22.0.1/
export ANDROID_PLATFORM_TOOLS=~/Android/Sdk/platform-tools/
PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS:$ANDROID_BUILD_TOOLS

And run:

source ~/.bashrc

or just close terminal and start it again.

Solution 5

I used the full path of zipalign. For mac, I found the executable file in Finder and clicked on it. Then, to publish my app I ran

/Users/username/development/sdk/tools/zipalign -v 4 HelloWorld-release-unsigned.apk HelloWorld.apk

instead of

zipalign -v 4 HelloWorld-release-unsigned.apk HelloWorld.apk
Share:
118,140
JMRboosties
Author by

JMRboosties

Updated on January 11, 2020

Comments

  • JMRboosties
    JMRboosties over 4 years
    cannot.find.zip.align=The zipalign tool was not found in the SDK.
    
    Please update to the latest SDK and re-export your application
    or run zipalign manually.
    
    Aligning applications allows Android to use application resources
    more efficiently.
    

    This is the message I received when I tried to publish my app. I'm using the latest revision of Android SDK Tools (23 which was released today) and SDK Platform-tools (20 which was also released today). I got an APK out of it, but if I tried to upload it to Google Play I got an error complaining that it is not zip aligned.

    Running zipalign manually fixes the apk, but does anyone know what causes this and how to fix it?

  • Joshua G
    Joshua G about 10 years
    Point of clarification, move the binary from your android sdk folder to the android studio's sdk folder. Like: C:\Program Files (x86)\Android\android-sdk\tools\zipalign.exe to C:\Program Files (x86)\Android\android-studio\sdk\tools\zipalign.exe
  • SnowInferno
    SnowInferno almost 10 years
    It must be a copy of the file and not a symbolic link in OSX. I used a sym-link (which is usually enough) and it was still not found.
  • Cigogne  Eveillée
    Cigogne Eveillée almost 10 years
    I had to restart eclipse after doing this
  • DooMMasteR
    DooMMasteR almost 10 years
    google has updated android studio (0.8.1) and the issues do not occur anymore with this newer version
  • shimi_tap
    shimi_tap almost 10 years
    Great video thanks, for me it worked by adding the zipalign to the tools and not platform tools
  • shimi_tap
    shimi_tap almost 10 years
    I found it under - sdk\build-tools\20.0.0
  • darksider474
    darksider474 almost 10 years
    Don't copy the exe from another directory. Use the SDK Manager to install SDK Build tools v20
  • david
    david almost 10 years
    When using ant build-release, one need to add sdk.buildtools=19.1.0 or =20.0.0 to project.properties. Also note that zipalign properties set has been changed in the ANT build.xml to point on the righ tool chain version.
  • Kevin
    Kevin almost 10 years
    As mentioned in some of the answers that you need to install Android SDK Build-tools Rev. 20. I did. But still getting the same error. Then i have to copy Zipalign from "sdk/build-tools/20.0.0" to "sdk/tools/"
  • bharal
    bharal almost 10 years
    I downvoted this - the correct answer is to get the build tools version 20 (as in the answer given by Pang)
  • Zala Janaksinh
    Zala Janaksinh almost 9 years
    Rev. 23.0.0 fix this issue... It's useful for latest build
  • Paul Samsotha
    Paul Samsotha over 8 years
    This link did help me, but instead of moving the zipalign.exe from the build-tools to the platform-tools, I just added the build-tools folder the PATH env
  • Sudhanshu Gaur
    Sudhanshu Gaur about 8 years
    Now Zipalign tool is present at this location at /path/to/sdk/build-tools/zipalign.exe
  • Sfseyhan
    Sfseyhan almost 8 years
    Zipalign is deprecated as of Android Plugin for Gradle, Revision 2.2.0 (September 2016). See my answer below for details. stackoverflow.com/a/39708969/5309676
  • Richard Chan
    Richard Chan over 6 years
    Android Studio->Tools->Android->SDK Manager->Android SDK ->SDK Tools -> check "Android SDK Build-Tools 28-rc1",then apply,you will install the build tools, and you can find zipalign.exe in SDK\build-tools\28.0.0-rc1 after installed.
  • Roman
    Roman over 6 years
    You are right, It should be installed, but was not installed in my case. I checked. This recipe is for those who do not have this file after all attempts.
  • Nadim
    Nadim over 6 years
    For windows (my zipalign path): C:\Users\Machine\AppData\Local\Android\Sdk\build-tools\27.0.‌​3\zipalign.exe My Example cmd & 'C:\Users\Machine\AppData\Local\Android\Sdk\build-tools\27.0‌​.3\zipalign.exe' -v 4 './platforms/android/app/build/outputs/apk/release/app-relea‌​se-unsigned.apk' './platforms/android/app/build/outputs/apk/release/app-relea‌​se-signed.apk'
  • Manan Shah
    Manan Shah almost 5 years
    just one edit: you missed the "export" in last line. :-)