Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build a 'release' APK in Android Studio?

I am trying to build an APK that I can upload to the Play Store.

When I select Build|Generate Signed APK... in Android Studio (version 0.3.1), I am directed to a link on how to properly set up the signing process in the "gradle build scripts":

enter image description here

http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Signing-Configurations

Unfortunately, after checking that page I'm at a loss as to what file to edit and what to put in it - I'm coming from a Visual Studio background, so lazily expect stuff to 'just work' :).

(After OK'ing Android Studio's warning message, A.S. brings up a Generate Signed APK Wizard, which I went through, passing my key's details. The resulting APK was rejected by the Play Store for having a key with a too-soon expiry-date).

I also tried bringing up the Android Studio Terminal window and running 'gradle', as instructed in the above message, but this command was not found. So as an aside, since perhaps running the command might do something useful, how would I run gradle?

I found a 'Gradle' window in the A.S. IDE, and tried building the assembleRelease target found in that window. However, the Run window output just shows "Executing external task 'assembleRelease'...".

like image 920
mackenir Avatar asked Oct 27 '13 15:10

mackenir


People also ask

How do I make an APK file on my Android?

In the Android menu, go to Build > Build Bundle(s) / APK (s) > Build APK(s). Android Studio will start building the APK for you. Once done, a pop-up on the bottom right will notify you of its completion.

What is app release APK?

With a release, you can manage your app's Android App Bundle (or APK for apps created before August 2021) and then roll out your app to a specific track.

What is the difference between debug APK and release APK?

Major differences are the debug apk and the release apk: For debug builds the apk will be signed with the default debug signing keys with debug flag enabled. For release apk you will have to explicitly specify the apk to sign with and the debug flag will be turned off so that it cannot be debugged.


2 Answers

Follow these steps in the IDE: Build -> Generate Signed APK -> Create new...

Then fill up "New Key Store" form. If you wand to change .jnk file destination then chick on destination and give a name to get Ok button. After finishing it you will get "Key store password", "Key alias", "Key password" Press next and change your the destination folder. Then press finish, thats all. :)

enter image description here

enter image description hereenter image description here

enter image description hereenter image description here

like image 121
Shohan Ahmed Sijan Avatar answered Oct 05 '22 18:10

Shohan Ahmed Sijan


Click \Build\Select Build Variant... in Android Studio. And choose release.

like image 20
Alexander Lubyagin Avatar answered Oct 05 '22 19:10

Alexander Lubyagin