cannot find zip-align when publishing app
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 Eclipse → Pull Down Menu → Window → Android 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
JMRboosties
Updated on January 11, 2020Comments
-
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 about 10 yearsPoint 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 almost 10 yearsIt 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 almost 10 yearsI had to restart eclipse after doing this
-
DooMMasteR almost 10 yearsgoogle has updated android studio (0.8.1) and the issues do not occur anymore with this newer version
-
shimi_tap almost 10 yearsGreat video thanks, for me it worked by adding the zipalign to the tools and not platform tools
-
shimi_tap almost 10 yearsI found it under - sdk\build-tools\20.0.0
-
darksider474 almost 10 yearsDon't copy the exe from another directory. Use the SDK Manager to install SDK Build tools v20
-
david almost 10 yearsWhen 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 almost 10 yearsAs 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 almost 10 yearsI downvoted this - the correct answer is to get the build tools version 20 (as in the answer given by Pang)
-
Zala Janaksinh almost 9 yearsRev. 23.0.0 fix this issue... It's useful for latest build
-
Paul Samsotha over 8 yearsThis 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 about 8 yearsNow Zipalign tool is present at this location at /path/to/sdk/build-tools/zipalign.exe
-
Sfseyhan almost 8 yearsZipalign 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 over 6 yearsAndroid 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 over 6 yearsYou 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 over 6 yearsFor 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-release-unsigned.apk' './platforms/android/app/build/outputs/apk/release/app-release-signed.apk'
-
Manan Shah almost 5 yearsjust one edit: you missed the "export" in last line. :-)