-3

I am trying to upload my first app to the play store, and the error message is telling me that I need to zip align my file. All the guides to doing so tell me to enter the command "$ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk" into the command line. What is the command line? I am having a great deal of trouble with this.

J. Guy
  • 21
  • 1
  • 6
  • https://en.wikipedia.org/wiki/Command-line_interface – ceejayoz Sep 26 '16 at 01:29
  • I tried entering it into the command line, but it tells me that $ is not valid. Is there other input I should enter? – J. Guy Sep 26 '16 at 01:36
  • how are you signing your apk? and how you even build it? – Kosh Sep 26 '16 at 01:36
  • Leave the `$` off. That's just the command line prompt on a Unix-based system like OSX or Linux. Just run the command `zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk` – ceejayoz Sep 26 '16 at 01:37
  • Now its telling me that zip align is not recognized as an internal or external command – J. Guy Sep 26 '16 at 01:41
  • 2
    If you make a release build your apk should already be zip aligned. Are you trying to upload the debug version of your apk? – Xaver Kapeller Sep 26 '16 at 02:30

1 Answers1

1

follow this step

1) we need to sign the unsigned APK and run an alignment utility on it to optimize it and prepare it for the app store. If you already have a signing key, skip these steps and use that one instead.

2) goto folder where keystore are saved and paste the unsigned apk to this folder or 2) create folder in paste keystore or apk in one folder

3) open command line in this folder using shift+right click and select command line (for Windows), right click ad select services and select 'command line at this folder' for(mac os)

4) enter below command

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore mykeystore.keystore HelloWorld-release-unsigned.apk alias_name

note:- replace name of keystore and apk. example

5) goto sdk folder

6) goto build-tools

7) open build version folder which version to generate sign apk

8) check zipalign.exe is in folder or not if not select other build version or update sdk

9) copy this path from address bar

ex. c:/sdk/build-tools/23.0.3

10) right click on my computer

11) click properties

12)select Advanced system setting in left side

13) paste this path to enviroment variable in path.

14) goto keystore and apk store folder where first command are apply

15) after all enter this command

16) zipalign -v 4 HelloWorld-release-unsigned.apk HelloWorld.apk

(optional) you can also see cannot find zip-align when publishing app

thank you.....

Community
  • 1
  • 1
vishal
  • 542
  • 6
  • 12