What is the location of the keystore file in Android Studio?
Asked Answered
H

7

16

I just recently found out the importance of backing up the keystore file in Android Studio. I have two apps published using this computer. Both times I simply used "Generate APK" in Android Studio Build drop down. I would really appreciate some instructions on where exactly can I find the keystore file that Android Studio used to sign those apks with and what else do I need to do to be able to publish updates to my apps from PC's other than this one. Thank you.

Hogweed answered 12/2, 2017 at 22:47 Comment(2)
Maybe let's check first :developer.android.com/studio/publish/app-signing.html. You can always generate your own signing key and attach via gradle.Schism
@Schism that documentation does not tell s single helpful thing about keys giving location results in an error in android studio saying file does not exists. Isnt that the entire point if file existed then i wouldnt try to generate oneMckown
P
2

If you used the apk after clicking "Build Apk", its a debug build apk from the output folder. Or if you used "Generate Signed Apk" you must have used a key as there is an option to create one.

Panther answered 12/2, 2017 at 23:4 Comment(2)
Its the first case. I used the Apk from the Output folder after clicking "Build Apk". Where can I find the keystore file that my Apk was signed with? I didn't sign the Apk myself.Hogweed
Please have a look here #9398519Panther
P
12

Try to check the menu: Build -> Generate Signed APK

The path to the keystore would be displayed on the first line of the new window.

But if you don't remember the passwords then I have some bad news for you :-(

Periphery answered 12/2, 2017 at 22:55 Comment(2)
could you clarify what the bad news is, and what steps are required to generate a new password if necessary?Greysun
You could not generate new password. In that case, the only option you have is to generate a new keystore file. Long time ago, developer have to use the same keystore to sign application's APK. Missed keystore means developer couldn't update their APK in Google-Play. This days google takes care of that (for good or for bad).Periphery
C
5

I found mine C:\Users\username\keystores\myappkey.jks

Caress answered 7/4, 2018 at 15:25 Comment(0)
L
3

There's a good chance you'll find it in "C:\Users\.gradle\gradle.properties". From Android Studio, you can find that file in "Gradle Scripts->gradle.properties(Global Properties)

Lemma answered 13/2, 2017 at 0:22 Comment(0)
M
3

Go To: Build -> Generate Signed APK

Select APK.

You would then be required to choose an existing keystore path or create one if u don't created it then create a new one... after that Go to Project Structure and set the keystore path that you have created... hope it works

Madeline answered 30/8, 2019 at 4:46 Comment(0)
P
2

If you used the apk after clicking "Build Apk", its a debug build apk from the output folder. Or if you used "Generate Signed Apk" you must have used a key as there is an option to create one.

Panther answered 12/2, 2017 at 23:4 Comment(2)
Its the first case. I used the Apk from the Output folder after clicking "Build Apk". Where can I find the keystore file that my Apk was signed with? I didn't sign the Apk myself.Hogweed
Please have a look here #9398519Panther
H
1

Go To: Build -> Generate Signed APK

Select Either Android App Bundle or APK.

You would then be required to choose an existing keystore path or create one

Hannah answered 1/5, 2019 at 14:56 Comment(0)
P
1

I finally could figure the issue out.

To get the Key Alias: I copied the keytool.exe and my keystore file into C:\Program Files\Java\jdk1.7.0_71\bin folder. Then from command prompt I wrote: keytool -list -v -keystore key.jks It will also ask for keystore password then. Then it will show you the key alias and Certificate fingerprints and other info.

Then I again tried to Generate Signed Apk for the project, I provided keystore, keystore password, key alias and provided the same password. Then it asks for master password, I tried with the same and it failed. With the reset option I reset the master password here.

Polymeric answered 25/8, 2021 at 13:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.