How to install and use ZIPALIGN on ubuntu 16.04 64bit?

2,236 views
Skip to first unread message

Barney Gumble Channel

unread,
Jan 8, 2018, 4:13:06 AM1/8/18
to kivy-...@googlegroups.com
i tryng to upload an apk on google developer but my apk is not zipaligned Cheers and Thanks

ZenCODE

unread,
Jan 8, 2018, 8:31:56 AM1/8/18
to kivy-...@googlegroups.com
In your home folder, your zipalign tool is stored in

    ~/.buildozer/android/platform/android-sdk-<sdk_no>/build-tools/<rev_no>/

You'll need to look to see exactly which versions are installed.

Instructions for using zipalign are here: https://developer.android.com/studio/command-line/zipalign.html
Message has been deleted

Barney Gumble Channel

unread,
Jan 8, 2018, 9:46:34 AM1/8/18
to kivy-...@googlegroups.com
Hello Zen
sorry I'm a beginner,is this path in the kivy virtual machine?
~/.buildozer/android/platform/
android-sdk-<sdk_no>/build-tools/<rev_no>/  Do I have to open android studio to run zipalign?   thank you very much






ZenCODE

unread,
Jan 9, 2018, 4:18:41 AM1/9/18
to Kivy users support
 Yes, that path in the the kivy VM. You'll need to change into that folder and then run

    ./zipalign -v 4 .....

Barney Gumble Channel

unread,
Jan 9, 2018, 5:32:05 AM1/9/18
to Kivy users support
i have try for 1 hour , i have not  find this path,can you  help me with a noob tutorial ? can u write me precisily because the kivy vm are all the same,thank you very much Zen

ZenCODE

unread,
Jan 9, 2018, 9:02:23 AM1/9/18
to Kivy users support
The paths are not all the same as they depend on the sdk version you have chosen and the revision number most recently installed. Are you sure you have you sdk installed. Have you tried searching in you ./buildozer folder for zipalign?

ZenCODE

unread,
Jan 9, 2018, 9:49:01 AM1/9/18
to Kivy users support
From inside the .buildozer folder...

    find ./ -name "zipalign"

Barney Gumble Channel

unread,
Jan 9, 2018, 10:40:43 AM1/9/18
to kivy-...@googlegroups.com
hello zen I can find this directory ~/.buildozer/android/platform$ android-sdk-<sdk_no>/build-tools/<rev_no>/
bash: sdk_no: No such file or directory

kivy@kivyvm:~/.buildozer$ find ./ -name "zipalign"
./android/platform/android-sdk-21/tools/zipalign
./android/platform/android-sdk-21/build-tools/19.1.0/zipalign
./android/platform/android-sdk-20/tools/zipalign
./android/platform/android-sdk-20/build-tools/19.1.0/zipalign



~/.buildozer/android/platform$ ls
android android-sdk_r20-linux.tgz
android-ndk-r9c android-sdk_r21-linux.tgz
android-ndk-r9c-linux-x86_64.
tar.bz2 apache-ant-1.9.4
android-sdk-20 apache-ant-1.9.4-bin.tar.gz
android-sdk-21

Zen i have find this information now tell me what can i do.Thanks

😀

Barney Gumble Channel

unread,
Jan 10, 2018, 5:19:11 AM1/10/18
to Kivy users support
HI Zen when u have time please help me understund thank you very much

ZenCODE

unread,
Jan 10, 2018, 10:56:59 AM1/10/18
to Kivy users support
Yes, the values in angle brackets are placeholders. They change depending upon your sdk. So, your search shows you where the zipalign command is. So, do a:

    cd ~/.buildozer/android/platform/android-sdk-21/build-tools/19.1.0/

You should then be able the run:

    ./zipalign -v 4 ...

where you replace the ... with the paths to your apk and output apk as documented for the zipalign command (link given in previous posts). If that is still unclear, perhaps do a tutorial on linux and how to run commands? Good luck


Barney Gumble Channel

unread,
Jan 10, 2018, 11:15:16 AM1/10/18
to kivy-...@googlegroups.com
Zen i tryng but i have not understund

the name of my apk is   MyApplication-0.1-release-unsigned.apk

the path is   /home/kivy/Desktop/provaAPP/bin

you can complete the route with the information I gave you, because it is not clear to me 

  ./zipalign -v 4... insert u please the command sorry for my english,you are the best Zen u help me always thanks

Barney Gumble Channel

unread,
Jan 10, 2018, 1:57:53 PM1/10/18
to Kivy users support
is not correct  zipalign -v 4 ~/home/kivy/Desktop/provaAPP/bin/MyApplication-0.1-release-unsigned.apk 
bash: zipalign: command not found can u help me Zen Thanks Cheers

ZenCODE

unread,
Jan 13, 2018, 1:31:21 AM1/13/18
to Kivy users support
Note the dot forward slash before zipalign,
Message has been deleted

Barney Gumble Channel

unread,
Jan 13, 2018, 3:14:04 AM1/13/18
to kivy-...@googlegroups.com
./zipalign -v 4 ~/home/kivy/Desktop/provaAPP/bin/MyApplication-0.1-release-unsigned.apk 

Zip alignment utility
Copyright (C) 2009 The Android Open Source Project

Usage: zipalign [-f] [-v] <align> infile.zip outfile.zip
       zipalign -c [-v] <align> infile.zip

  <align>: alignment in bytes, e.g. '4' provides 32-bit alignment
  -c: check alignment only (does not modify file)
  -f: overwrite existing outfile.zip
  -v: verbose output

i dont know why no work i have read some information output input but i have no understund thanks always Zen

ZenCODE

unread,
Jan 13, 2018, 6:58:40 AM1/13/18
to Kivy users support
You need to specify the output file as well.

    
./zipalign -v 4 ~/home/kivy/Desktop/provaAPP/bin/MyApplication-0.1-release-unsigned.apk  ~/home/kivy/Desktop/provaAPP/bin/MyApplication-0.1-aligned.apk

Barney Gumble Channel

unread,
Jan 13, 2018, 7:18:05 AM1/13/18
to Kivy users support
No work

kivy@kivyvm:~/.buildozer/android/platform/android-sdk-21/build-tools/19.1.0$ ./zipalign -v 4 ~/home/kivy/Desktop/provaAPP/bin/MyApplication-0.1-release-unsigned.apk

Zip alignment utility
Copyright (C) 2009 The Android Open Source Project

Usage: zipalign [-f] [-v] <align> infile.zip outfile.zip
       zipalign -c [-v] <align> infile.zip

  <align>: alignment in bytes, e.g. '4' provides 32-bit alignment
  -c: check alignment only (does not modify file)
  -f: overwrite existing outfile.zip
  -v: verbose output

kivy@kivyvm:~/.buildozer/android/platform/android-sdk-21/build-tools/19.1.0$ ~/home/kivy/Desktop/provaAPP/bin/MyApplication-0.1-aligned.apk
bash: /home/kivy/home/kivy/Desktop/provaAPP/bin/MyApplication-0.1-aligned.apk: No such file or directory

ZenCODE

unread,
Jan 13, 2018, 7:24:24 AM1/13/18
to kivy-...@googlegroups.com
You need both the input file path and the output one. Like I posted above. You have only entered one path in your command.

Barney Gumble Channel

unread,
Jan 13, 2018, 7:26:58 AM1/13/18
to kivy-...@googlegroups.com
READ THIS AFTER INSERT BOTH COMMANDS Unable to open '/home/kivy/home/kivy/Desktop/provaAPP/bin/MyApplication-0.1-release-unsigned.apk' as zip archive
I HAVE RESOLVED AFTER ERASER HOME KIVY HOME KIVY IN BOTH LINES THANK YOU VERY MUCH ZEN

THE NEXT STEP IS SIGN APK IN GOOGLE DEVELOPER OR IN VIRTUAL MACHINE KIVY?? THANKS AGAIN ZEN

Barney Gumble Channel

unread,
Jan 13, 2018, 8:14:45 AM1/13/18
to kivy-...@googlegroups.com
RESOLVED THANKS ZEN YOU ARE THE BEST......i have upload a apk in google developer console but when the download is Finish i have this ERROR: JAR_SIG_NO_MANIFEST: Missing META-INF/MANIFEST.MF i  have not sign the apl i open new Topic? thanks in advance Zen

ZenCODE

unread,
Jan 13, 2018, 5:23:06 PM1/13/18
to Kivy users support
You need to sign it in order to upload. That is a requirement of the google Play store.

https://stablekernel.com/creating-keystores-and-signing-android-apps/

Barney Gumble Channel

unread,
Jan 14, 2018, 7:51:09 AM1/14/18
to kivy-...@googlegroups.com

Thanks Zen but can u help me here  with keystore,Thanks you so much for your support!!!
The requirements for make application are  keystore,signapk and zipalign ???

ZenCODE

unread,
Jan 14, 2018, 1:18:34 PM1/14/18
to Kivy users support
That is all standard Java android stuff and not Kivy specific. A google reveals lot's of tutorials and examples. There is lots of help out there on this. Just try it and make a new post if you get stuck.  Good luck :-)

Barney Gumble Channel

unread,
Jan 14, 2018, 2:05:04 PM1/14/18
to kivy-...@googlegroups.com

Hello ZenThanks again for your help :) i try find in google. If i get stuck i will open a new post here Cheers :)

Alireza Ebrahimi

unread,
Sep 10, 2018, 1:14:19 PM9/10/18
to Kivy users support
Hello zen

I try install zipalign on kali linux 2018.3 rolling



apt-get install zipalign
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package zipalign is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'zipalign' has no installation candidate


Please help me

ZenCODE

unread,
Sep 10, 2018, 3:21:00 PM9/10/18
to Kivy users support
zipalign installs with the android sdk. If you're using buildozer, it would be something like

/home/<username>/.buildozer/android/platform/android-sdk-23/build-tools/23.0.1/zipalign
Reply all
Reply to author
Forward
0 new messages