Release APK using Android Studio

1 minute read

I recently moved my Android projects from Eclipse (ADT) to Android Studio. I fixed some bugs so I wanted to update my APK on Google Play.

The problem

First I lost my key store during a reinstall of my computer. I couldn’t update my APK because the keys were different. I’m writing this here because you never will be able to update your APK again if you lose your key store. The only way to solve this is to create a new app, so you’ll lose all your current users. Luckily I could retrieve my key store from an old backup.

Then the second (and main) problem showed up. Apparently Android Studio builds a debuggable APK by default, which can’t be uploaded to Google Play:

You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play. Learn more about debuggable APKs.

Building a release APK

After searching for a long time (almost all solutions say you should change your build.gradle file, which isn’t necessary) I found the solution myself.

  • Open the View menu
  • Go to Tool Windows and select Build Variants
  • The Build Variants window will show up (in my case on the left)
  • Select Build Variant release for your module (in my case app)
    APK build variant
  • Open the Build menu
  • Click on Generate Signed APK...
  • Follow the on-screen instructions like usual
    Don’t forget to use the same key store/key as you used for the previous version of your app.

I hope this tutorial saved you some time!

Updated:

Leave a comment