I have just finished and signed the apk through android studio, then I have did an apk protect through apkprotect.com when I am trying to upload the apk to play store I got this 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. " if I upload the original apk I got no errors,
I have tried to add zipalign true in the build.gradle but nothing happened I have tried also disable and enable proguard .
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.
The unaligned apk is just an intermediate product. the unaligned apk is generated. the unaligned gets aligned and produces the aligned apk.
Any APK file is a valid ZIP file. There's more to it than that - files that must be present, the fact that zipalign is normally used to align data structures within the file - but it's all valid ZIP.
Creating a Signed APK File To generate a signed APK file, open the Build menu from the toolbar and select Generate Signed Bundle/APK. This opens up a screen where you have to select between creating an Android App Bundle and creating an APK file.
You can run zipalign manually in command line:
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
Note that zipalign is located inside ${sdk.dir}\tools
For more details visit zipalign
[Update]
Also, If you need to sign it you can run:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore YOURKEYSTORE unsigned.apk alias_name
(jarsigner is located inside java JDK_HOME/bin)
I got the same "You uploaded an APK that is not zip aligned... blah, blah" error when by mistake I tried to upload a DEBUG version of my .apk file to Google Play. It's a bit misleading error because the real problem is that you cannot distribute a debug version which additionally is not signed with your Google Android Developer key. (You can only upload an .apk compiled as release version, and it must be signed, which happens in the same step, at least if you're using Eclipse).
Make sure you distribute an .apk file which is your Signed Release version, as described here:
http://developer.android.com/tools/publishing/app-signing.html#releasecompile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With