user2073729
user2073729

Reputation: 1171

zipalign' is not recognized as an internal or external command

I Wrote an android app. I type zipalign myApp.apk on cmd at windows 7 and I get:

zipalign' is not recognized as an internal or external command operable program or batch file

What is the problem

Upvotes: 14

Views: 39373

Answers (10)

Muhammed Moussa
Muhammed Moussa

Reputation: 5195

im comming from ionic-doc, and thiew way works form me by adding this to PATH

/path/to/Android/sdk/build-tools/VERSION/zipalign

Upvotes: 0

Albin C S
Albin C S

Reputation: 348

Try this

zipalign -v 4 app-release-unsigned.apk xxx.apk

instead put infront of above command

./

while you run it in terminal

\platforms\android\app\build\outputs\apk\release>./zipalign -v 4 app-release-unsigned.apk xxx.apk

Upvotes: 1

Petro
Petro

Reputation: 3652

An example on how to run zipalign without adding the path variable from CMD prompt:

C:\Users\mywindowsusername\AppData\Local\Android\Sdk\build-tools\27.0.3\zipalign.exe -v -p 4 my-app-unsigned.apk my-app-unsigned-aligned.apk

Upvotes: 7

Ravikumar Valluri
Ravikumar Valluri

Reputation: 1

Copy zipalign exe file into the Android\Sdk\build-tools\ folder and add path in environment variables ...

Upvotes: 0

Sanjoy Kanrar
Sanjoy Kanrar

Reputation: 897

Go to

Android/sdk/build-tools/VERSION/zipalign

copy the zipalign.exe into the current directory

and then run it. Example:

enter image description here

enter image description here

Now to optimize the APK , run the following command

E:\app publish\J\JQuery Reference>zipalign -v 4 jquery-reference-unsigned.apk jq ueryReference.apk

Upvotes: 8

cbyte
cbyte

Reputation: 701

If you are using powershell like I was, exit and use standard windows command prompt and then it will execute :)

Upvotes: 0

Jez D
Jez D

Reputation: 1489

Zipalign.exe is located in /path/to/android/sdk/build-tools/sdk-number

In command line:

  1. Navigate to the location where zipalign.exe can be found
  2. Run: zipalign -v -f 4 /full/path/to/apk/unaligned-apk.apk /full/path/to/new-aligned-apk.apk

Upvotes: 3

CrackedKnife
CrackedKnife

Reputation: 251

zipalign.exe can be found in the build tools (my path in my PC is C:\Users\[user name]\Developer\adt-bundle-windows-x86_64-20131030\sdk\build-tools), in my builds 19.1.0 and 20.0.0 folders. If you can't find it, fire up Windows Explorer and search for zipalign.exe, likely in C:\, unless you have installed in another drive.

Copy zipalign.exe to the tools folder, same level as build-tools (in my case, it is C:\Users\[user name]\Developer\adt-bundle-windows-x86_64-20131030\sdk\tools). Once done, I could compile successfully.

Upvotes: 25

sivi
sivi

Reputation: 11114

you can also try this:

1.search for zipaligned in main search bar

2.copy it to current directory

3.run your commands without changing anything

4.it works! :)

Upvotes: 1

RvdK
RvdK

Reputation: 19790

You should navigate to the directory wich has the zipalign executable in it.

Upvotes: 3

Related Questions