How to zip Align APK file in android?

2019-01-31 02:53发布

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 ?

7条回答
再贱就再见
2楼-- · 2019-01-31 03:28

If you use eclipse the easiest way is to do it directly from it.

Go to "File" -> "Export" -> "Android Application Export"

Select Android Application Export

The tool would ask you if you already have a keystore, if you do use it if not create a new one and save it on a safe place (you must remember the password so be sure to keep it somewhere you cannot lose it).

Then upload the file and there should be no errors.

查看更多
萌系小妹纸
3楼-- · 2019-01-31 03:28

Just make sure you upload the "app-release.apk" file. You find it at this location: Your_Project_Folder/app/app-release.apk

查看更多
做个烂人
4楼-- · 2019-01-31 03:29

I had a similar issue and tried all of the hints that are listed here but not cigar, I thought it was a bug but all my other Apps would work is just one of them had the issue e.g. after passing the not zip align I'd get You uploaded a debuggable apk. I was generating the apk from Eclipse/Indigo and the problem was the last step where it specifies the apk path somehow was pointing to some subdirectory had no idea how that one got in there, but using the proper path took care of it.

查看更多
闹够了就滚
5楼-- · 2019-01-31 03:31

Check themanifest.xml file in your project it should say something like this:

android:debuggable="true"

set it to "false".

查看更多
Animai°情兽
6楼-- · 2019-01-31 03:32

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

查看更多
迷人小祖宗
7楼-- · 2019-01-31 03:37

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
查看更多
登录 后发表回答