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.
-
Maybe let's check first :https://developer.android.com/studio/publish/app-signing.html. You can always generate your own signing key and attach via gradle. – Rafal Feb 12 '17 at 22:52
-
@Rafal 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 one – nikoss Jul 15 '20 at 09:26
7 Answers
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 :-(

- 2,601
- 3
- 18
- 25
-
could you clarify what the bad news is, and what steps are required to generate a new password if necessary? – WhooNo May 12 '22 at 15:17
-
1You 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). – MaxV May 17 '22 at 00:53
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)

- 1,750
- 1
- 19
- 33
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.

- 4,004
- 2
- 29
- 49
-
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. – Rehan Yousaf Feb 13 '17 at 17:26
-
Please have a look here http://stackoverflow.com/questions/9398019/i-cant-find-the-debug-keystore-file – sadat Feb 15 '17 at 02:07
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

- 81
- 1
- 3
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.

- 55
- 5
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

- 2,530
- 1
- 19
- 31