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 !!!

2 Answers 2

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

4
  • 15
    I had te same issue. The aligned apk is generated on app/ folder, not in output/ folder.
    – DragonT
    Commented Nov 25, 2015 at 12:39
  • The confusion is, there are two .apks generated one is not aligned another is (in a different folder as pictured).
    – halxinate
    Commented Feb 24, 2016 at 1: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
    Commented Mar 29, 2016 at 16:08
  • 1
    Doesn't work, app-release.apk is still not zip-aligned
    – gegobyte
    Commented Jul 11, 2016 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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.