How to zipalign the .apk file using eclipse?

AndroidAndroid Install-ApkZipalign

Android Problem Overview


Can anyone tell me how to zipalign my .apk file with using eclipse. I have made my .apk file by giving command like,

  1. Right Click on Project Folder

  2. Click on "Android Tools" option from menu.

  3. Click on "Export Signed Application Package..." and my .apk generated in given application alias.

Now want to do zipalign for this above generated .apk file. Does any tool require to do so OR anything that can solve my problem.

Android Solutions


Solution 1 - Android

If you did what you described above then Eclipse has already zipaligned your apk for you. You can't zipalign an already zipaligned package

Solution 2 - Android

I think this will help you

D:\android-sdk\android-sdk\tools>zipalign -f -v 4 "C:\Users\name\Desktop\project_name\projectname_signed.apk" "C:\Users\name\Desktop\project_name\projectname__zipaligned.apk"

Solution 3 - Android

Using the steps given, Eclipse will do zipalign for you.

Solution 4 - Android

This is a very tricky part and initially i was also ran in to strange problems . Before uploading to android market you must do the following steps.

  • Create a Certificate
  • Signing your application apk
  • Finally Zip align the signed apk

Check this site: How to sign Android project apk

Solution 5 - Android

Eclipse zipalign APKs when you export them by default.

zipalign is basically a tool available in tools directory of your android sdk.

In case you are not using eclipse to build, you can use this tool directly to zipalign your apk.

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

The alignment is an integer that defines the byte-alignment boundaries. This must always be 4 (which provides 32-bit alignment) or else it effectively does nothing.

For more detail, check this link http://developer.android.com/tools/help/zipalign.html

Solution 6 - Android

If you to signed and zip aligned your APK file, so that you could redistribute your file and upload it play store. Then follow these simple steps

  • Open Eclipse
  • File--> Export
  • Browse-->Select your project
  • Next-->Next

So, after all of that you will get an APK which will be signed and zip aligned.

Solution 7 - Android

Eclipse zipalign apk automatically. When you export the project, eclipse must be generating signed apk to a different destination. Check properly where it prompts when you generate a signed apk

Solution 8 - Android

Eclipse automatically zipaligns your .apk file if you did what you described above.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTej ZaveriView Question on Stackoverflow
Solution 1 - AndroidapesaView Answer on Stackoverflow
Solution 2 - AndroidMuhamed Riyas MView Answer on Stackoverflow
Solution 3 - AndroidSteelBytesView Answer on Stackoverflow
Solution 4 - Androiddroid kidView Answer on Stackoverflow
Solution 5 - AndroidPratap SinghView Answer on Stackoverflow
Solution 6 - AndroidPir Fahim ShahView Answer on Stackoverflow
Solution 7 - Androiduser2780638View Answer on Stackoverflow
Solution 8 - AndroidfidazikView Answer on Stackoverflow