Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to zip Align APK file in android?

I am uploading my first APK file to google play but I am getting following error.

You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.

Can any one tell me how to zip align my apk file ?

Please tell me steps for that ?

like image 336
Luckyy Nickey Avatar asked Apr 28 '14 06:04

Luckyy Nickey


People also ask

What is zip align for APK?

zipalign is a zip archive alignment tool. It ensures that all uncompressed files in the archive are aligned relative to the start of the file. This allows those files to be accessed directly via mmap(2) , removing the need to copy this data in RAM and reducing your app's memory usage.

Do I need to Zipalign AAB?

For AAB files, there is no official guide to zipalign, so it is not required.

Where can I find Zipalign?

Zipalign Command (Step-By-Step) Navigate to your program files directory and open up android-sdk> build-tools > the build-tools version you have (27.0. 3 for me). At the bottom of that folder you should see your zipalign file.


2 Answers

Read the documentation from Google itself

The steps should be simple to follow.

Please follow this doc from google for complete publishing details

In short,complete steps in a nutshell(I am assuming you use eclipse/android sdk):

 1. Check android_manifest.xml and verify that android:debuggable  attribute is set to false in your manifest file              2. Check the android:versionCode and android:versionName attributes.      (if this is the first time you are uploading a apk,        ignore, else if it is a new version of existing apk, make sure these        values are larger than previous apk)  3. Export unsigned application package from Eclipse  4. Sign the application using release key certificate(not debug key certificate)  5. Zip align the package  6. Upload in google play 
like image 136
A Nice Guy Avatar answered Sep 24 '22 15:09

A Nice Guy


If you use Eclipse export wizard, it will automatically align it for you. However you can do it manually yourself

To align infile.apk and save it as outfile.apk:

zipalign [-f] [-v] <alignment> infile.apk outfile.apk 

This website can provide more answers :) http://developer.android.com/tools/help/zipalign.html

like image 27
Jerry Avatar answered Sep 25 '22 15:09

Jerry