I am new to android development and just finished my first app. I want to generate a signed apk in android studio. I read the developer docs but couldn\'t understand the ste
Official Android Documentation on the matter at hand with a step-by-step guide included on how to generate signed APK keys in Android Studio and even on how to setup the automatic APK key generation in a Gradle build.
https://developer.android.com/studio/publish/app-signing.html
Look under the chapter: Sign your release build
The "official" way to configure the build.gradle file as recommended by Google is explained here.
Basically, you add a signingConfig, in where you specify the location an password of the keystore. Then, in the release build type, refer to that signing configuration.
...
android {
...
defaultConfig { ... }
signingConfigs {
release {
storeFile file("myreleasekey.keystore")
storePassword "password"
keyAlias "MyReleaseKey"
keyPassword "password"
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
...
Use Keytool binary or exe to generate a private keystore. Instructions here. You can then sign your app using this keystore. Keytool gets installed when you install Java.
NOTE: Save/backup this keystore because once you publish an app on play by signing it with this keystore, you will have to use the same keystore for any future updates. So, it's important that you back it up.
HTH.
Read this my answer here
How do I export a project in the Android studio?
This will guide you step by step to generate signed APK and how to create keystore file from Android Studio.
From the link you can do it easily as I added the screenshot of it step by step.
If you have Key-store file then you can do same simply.
Go to Build then click on Generate Signed APK
Simple 5 visual steps:
Step 1: Click Build -> Generate Signed Build/APK
Step 2: Choose APK -> Next
Step 3: Click Create new ...
Step 4: Fill necessary details
Step 5: Choose build variant debug/release
& Signature Versions (V2)
All done, now your Signed APK will start building and should popup on bottom right corner once available. Click locate
to get your signed APK file.
Easy?
I had the same problem. I populated the field with /home/tim/android.jks file from tutorial thinking that file would be created. and when i would click enter it would say cant find the file. but when i would try to create the file, it would not let me create the jks file. I closed out of android studio and ran it again and it worked fine. I had to hit the ... to correctly add my file. generate signed apk wizard-->new key store-->hit ... choose key store file. enter filename I was thinking i was going to have to use openjdk and create my own keyfile, but it is built into android studio