20

I am using Android Studio 1.2.2

My sdk is well updated and build-tools version installed is 22.0.1

Build > Generate Signed Apk

I only get app-release-unaligned.apk in (app/build/outputs/apk/)

I have already googled and tried:

  1. Copy Pasting "zipalign.exe" from build-tools folder to : (i) sdk/tools/ (ii) sdk/platform-tools/

  2. Adding "zipAlignEnabled true" under buildTypes in build.gradle

  3. Gradle zipAlign task not working?

Please help solve this issue, I want to zipalign using Android Studio.

This is my first app i am trying to publish !!!

Community
  • 1
  • 1
Shivam
  • 457
  • 1
  • 6
  • 15

2 Answers2

33

It is pretty easy to generate the signed apk file with Android Studio.

Here are the steps:

enter image description here

enter image description here

enter image description here

yushulx
  • 11,695
  • 8
  • 37
  • 64
  • 15
    I had te same issue. The aligned apk is generated on app/ folder, not in output/ folder. – DragonT Nov 25 '15 at 12:39
  • The confusion is, there are two .apks generated one is not aligned another is (in a different folder as pictured). – halxinate Feb 24 '16 at 01:45
  • @yushulx Not so straight-forward with me. I do not see that icon or the `apk` upfront as you've shown. Did not create the project from scratch in `AndroidStudio`, had to import it from `Eclipse` - could that be why? I will continue looking, but if you know off-hand where this zipaligned `apk` is in my scenario, please reply. Thanks! – Narayana J Mar 29 '16 at 16:08
  • 1
    Doesn't work, app-release.apk is still not zip-aligned – gegobyte Jul 11 '16 at 14:38
0

You probably are generating it, but the release .apk file is placed in a different directory from the other .apk files.

On my system, for an app called TheApp, .apk files are usually placed in the build/outputs/apk directory:

TheApp/build/outputs/apk/TheApp-debug.apk
TheApp/build/outputs/apk/TheApp-debug-unaligned.apk
TheApp/build/outputs/apk/TheApp-release-unaligned.apk

but the aligned release .apk file is placed directly in the app's root directory :

TheApp/TheApp-release.apk

(This was already answered by @yushulx but I hope this shorter answer is clearer).

Kai Carver
  • 2,240
  • 29
  • 23