-1

I am not able to optimise my apk that I created using Buildozer. when is use the optimize command:

$ ~/.buildozer/android/platform/android-sdk-20/build-tools/23.0.1/zipalign -v 4 ./bin/Your-App-0.1-release.apk ./bin/Your-App-0.1-release-optimized.apk

its saying bash :

no such file or directory. 

plus I don't know which sdk I'm using. my project location is Desktop/mobileapp/bin/TibetanAstroCalendar-0.1-Release-unsigned.apk (I created the release version

and one more question : - from which directory do I need to run the optimize command

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • Probably need to change `./bin/Your-App-0.1-release.apk` in that command to `./bin/TibetanAstroCalendar-0.1-Release-unsigned.apk` – John Anderson Apr 05 '19 at 18:26
  • The questions I asked was edited by some one. and given some wrong information. my main apk file is in a folder called mobileapp which is on the desktop of the kivy virtual machine. the command initial command ~buildozer is I guess going into the folder called buildozer which is on the home ,, but there is no folder called buildozer in my vm home – Tenzin Dayoe Apr 06 '19 at 15:03
  • can you please suggest the code. The information are as follows:- 1. location of app is home/kivy/desktop/mobileapp/bin/ and apk name is TibetanAstroCalendar-1.0-release-unsigned.apk. – Tenzin Dayoe Apr 06 '19 at 15:09

1 Answers1

0

I suggest installing the zipalign package. In Ubuntu, that would simply be:

sudo apt-get install zipalign

Then do:

cd home/kivy/desktop/mobileapp/bin
zipalign -v -p 4 TibetanAstroCalendar-1.0-release-unsigned.apk aligned.apk

That is based on your provided information, but perhaps that directory is /home/kivy/desktop/mobileapp/bin? Is a leading / missing? You can replace the name aligned.apk with any file name you like.

If you cannot or do not want to install the zipalign package, look for any zipalign under .buildozer in your home directory, then replace zipalign with the path to the zipalign you found.

Some versions of zipalign do not recognize the -p option. If you get an unrecognized option error, just leave off the -p.

John Anderson
  • 35,991
  • 4
  • 13
  • 36
  • when I try to install the zipalign its giving an error . unable to fetch some archives maybe run apt-get update or try --fix-missing. Which directory do you mean by the home . There is a directory called home in my system , but there is nothing called buildozer but only a folder called kivy – Tenzin Dayoe Apr 07 '19 at 08:44
  • So do what it suggested. run `sudo apt-get update`, then retry the `install`. The directory we are talking about is not `buildozer` it is `.buildozer` (notice the leading `.`). Directories with a leading `.` are normally not shown, but `ls -a` will show all directories. – John Anderson Apr 07 '19 at 13:47
  • sudo apt-get is not also working bro. Maybe the problem is that I'm using the kivy virtual machine? – Tenzin Dayoe Apr 07 '19 at 14:04
  • Didn't know you are actually on Windows. Try this [answer](https://stackoverflow.com/questions/36916462/how-to-zipalign-the-apk-file-in-windows). – John Anderson Apr 07 '19 at 14:16
  • or [this](https://stackoverflow.com/questions/48988837/buildozer-unsigned-release-apk-saved-in-windows-folder-now-need-to-zipalign-and) – John Anderson Apr 07 '19 at 14:20
  • I'm on a Mac . thanks for your good response and helpful nature – Tenzin Dayoe Apr 07 '19 at 14:22
  • please help me fast I'm in a big trouble coz I need to publish this app today and need to show it tomorror – Tenzin Dayoe Apr 07 '19 at 14:25
  • Hey , thanks I was able to solve this. actually the problem was that my version was 20 and the file inside the build tools was 19.1.0 , I was just typing the build tool version 21.0.1. Thank you John Anderson – Tenzin Dayoe Apr 07 '19 at 14:31