174

I need to enable google+ api, so I need the debug.keystore. I switched to Android Studio and do not know where it is. I can find it in eclipse at path ~/.android/debug.keystore.

Ali Bdeir
  • 4,591
  • 9
  • 46
  • 101
complez
  • 6,552
  • 11
  • 44
  • 54
  • 4
    I would assume that Android Studio uses the same debug keystore. That one is not tied to Eclipse -- Ant uses it as well. – CommonsWare Jun 06 '13 at 14:51
  • Did you build or run the project on a device? It won't be there unless you've built an apk atleast once. – Siva Velusamy Jun 06 '13 at 14:56
  • Build for debug or production? – complez Jun 06 '13 at 15:17
  • Duplicate of http://stackoverflow.com/questions/16622528/android-studio-debug-keystore. Useful: http://stackoverflow.com/questions/17189076/what-is-the-equivalent-of-eclipse-custom-debug-keystore-in-android-studio – Sofi Software LLC Jul 10 '13 at 18:54
  • See also https://stackoverflow.com/questions/12456491/i-dont-remember-my-android-debug-keystore-password – caw Apr 19 '19 at 22:07

17 Answers17

161

EDIT Step 1) Go to File > Project Structure > select project > go to "signing" and select your default or any keystore you want and fill all the details. In case you are not able to fill the details, hit the green '+' button. I've highlighted in the screenshot.enter image description here

Step 2) VERY IMPORTANT: Goto Build Types> select your build type and select your "Signing Config". In my case, I've to select "config". Check the highlighted region. enter image description here

Prachi
  • 3,327
  • 2
  • 20
  • 38
  • 13
    I can't see "Facets" written anywhere in Project Structure. – d34th4ck3r Jan 16 '14 at 13:08
  • 2
    Which Studio are you using? If it is Studio 0.3.2 or above, then I am with you on this one! – Prachi Jan 16 '14 at 14:19
  • bummer! I'll explore it in a while. Doing a big project and don't want to upgrade and mess my IDE settings! Meanwhile, can you please update it to us if you find it? – Prachi Jan 20 '14 at 08:52
  • 7
    I just ran the hello world project once on Android Studio, and it appeared at ~/.android/ – d34th4ck3r Jan 21 '14 at 14:33
  • 6
    Answer is not valid anymore. – David Feb 18 '15 at 16:26
  • 1
    Answer is not valid anymore. – MohsinSyd Apr 23 '15 at 12:32
  • Thanks for bringing to my notice. I've edited my answer! Please let me know if any issues :) – Prachi Apr 23 '15 at 16:09
  • 10
    @Vera You might want to to mention that the key alias is likely to be 'androiddebugkey' (this is the default), not 'android'. – Tom Apr 28 '15 at 19:39
  • I hope people already know about the alias naming. I just posted sample :) Thanks! – Prachi Apr 29 '15 at 06:02
  • 1
    where can i find the store file :debug.keystore. in my system both eclipse and android studio installed now am work with studio.no one is giving correct process from couple of days am seraching for google places api integration process for development and please any one help me. – Harsha Sep 23 '15 at 05:04
  • Harsha - In my system my debug.keystore is at this location (you should be able to figure yours out from this). Mine is Windows 7: C:\Users\homepc\.android – user1406716 Sep 24 '15 at 03:22
  • but no keystore path displayed here every field is empty – Harsha Nov 09 '16 at 08:55
  • Hello @Harsha, please give a screenshot of what you get. try to click that green '+' button and click the '...' button to look for keystore. – Prachi Nov 09 '16 at 09:17
  • 1
    You can make your project compatible among multiple users by editing the signing configs section in the build.gradle file, and changing storeFile as follows: `storeFile file("$System.env.USERPROFILE" + '/.android/debug.keystore')` – Tjaart Jun 16 '17 at 09:27
  • 1
    Worked for me. I had to set 'Signing config' to 'config' for both debug & release. Now I can use the same Google API keys for debug & release. Makes things a bit easier. – SoloPilot Aug 21 '18 at 16:50
  • 1
    Thx Prachi. I was having logging in issues using Google Drive API and it turned out to be a signing issue solved by combining your answer here and that of alexshr below. – Bill Nov 16 '18 at 18:46
  • 1
    Works, I accidentally deleted or changed my config files so the IDE was looking for the keystore in the default folder (C:\Users\USERNAME\.android\debug.keystore). I made the changes in the Project Structure and my app is running. – Sumanpal Singh Saggu Jul 30 '19 at 12:36
  • This variable can be used in signing config filed: $signingConfigs.debug to sign with debug key. – Shailendra Yadav Dec 31 '19 at 11:57
104
  • For Windows User: C:\Users\USERNAME\.android\debug.keystore (Replace USERNAME with your actual PC user name)

  • For Linux or Mac OS User: ~/.android/debug.keystore

After you will get SHA1 by below Code using Command Prompt:

  keytool -list -v -keystore "C:\Users\USERNAME\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Jonathan Natie Klopper
  • 2,246
  • 3
  • 17
  • 18
Samir Mangroliya
  • 38,074
  • 16
  • 111
  • 131
67

In Android Studio you can find all your app signing information without any console command:

  1. Open your project

  2. Click on Gradle from right side panel

  3. In Gradle projects panel open folders: Your Project -> Tasks-> Android

  4. Run signingReport task (double click) and you will see the result in Gradle console (keystore paths,SHA1,MD5 and so on).

signingReport task and its result

alexshr
  • 939
  • 8
  • 12
  • 2
    Thanks..this worked for me..After running the signinReport command..i was able to point to the right SHA1 key that my app was using – John Aug 31 '17 at 14:52
  • i am looking for release key store. Variant: release, config: none. but I already set up release key. please help. – windchime Oct 05 '17 at 14:20
  • 1
    Hey, Alex thank u very much, your answer is awesome. Good Luck. – MohanRaj S Oct 11 '17 at 11:33
  • After 2 days of cleaning and trying you helped me. XOXO – M at Dec 02 '17 at 20:41
  • Thx alexshr. I was having logging in issues using Google Drive API and it turned out to be a signing issue solved by combining your answer here and that of Prachi above. – Bill Nov 16 '18 at 18:46
  • +1 Apart from generating SHA1 etc. it also tells the path/location of debug keystore being used for that project. – gprathour Sep 09 '19 at 06:17
  • this is the best! accepted answer does not work when default values are used (i.e. debug keystore was not specified in my case). turned out `.android` folder in my android SDK was being used.. – mx1up Aug 18 '20 at 13:31
  • Thank you so much now I don't have to remember the command – princebillyGK Mar 16 '21 at 04:15
  • this should be the accepted answer as of today – FuMe Apr 02 '21 at 09:32
52

Another way of finding out your key information is to go to your java folder, for me it was at

C:\Program Files\Java\jdk1.8.0_60\bin

and run the following command

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

from the command you can easily see that keystore address is "c:\users/<%mylogin%>.android\debug.keystore" , alias is "androiddebugkey" store password is "android" key password is "android"

This is the default configuration from the Android 'Get API Key' documentation. https://developers.google.com/maps/documentation/android-api/signup

Daniël van den Berg
  • 1,941
  • 1
  • 16
  • 37
Matt.Harris
  • 669
  • 5
  • 7
  • 1
    If you are using a new version of Android Studio(my version is 2.2.2), you can find keytool in "C:\Program Files\Android\Android Studio\jre\bin". – Min Nov 30 '16 at 09:59
33

You can use this command and will fetch all your key-stores, go to your terminal and in your android root directory run this:

./gradlew signingReport

it will give you something like this a list of key-store and their information:

enter image description here

BlaShadow
  • 8,375
  • 7
  • 32
  • 58
20

I got this problem. The debug.keystore file was missing. So the only step that created a correct file for me was creating a new Android project in Android Studio.

It created me a new debug.keystore under path C:\Users\username\.android\.

This solution probably works only when you have not created any projects yet.

Tunaki
  • 116,530
  • 39
  • 281
  • 370
Vitor Braga
  • 1,933
  • 1
  • 20
  • 19
17

It helped me.

Keystore name: "debug.keystore"
Keystore password: "android"
Key alias: "androiddebugkey"
Key password: "android"

exapmle

USER_NAME_PC - Your PC username

Enea Dume
  • 2,571
  • 3
  • 14
  • 33
3

If you find that you do not have JDK installed. Go to your android terminal and navigate to the bin folder of JRE that comes with Android Studio.

C:\Program Files\Android\Android Studio\jre\bin

and run the following command. Remember to replace USERNAME with your actual PC username.

keytool -list -v -keystore "C:\Users\USERNAME\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
Hervera
  • 361
  • 2
  • 15
2

On Windows,

All you need to do is goto command prompt and cd C:\Program Files\Java\jdk-10.0.2\bin>where jdk-10.0.2 or full path can be different in your case. once you are in the bin, enter this code keytool -keystore C:\Users\GB\.android/debug.keystore -list -v where C:\Users\GB\.android/debug.keystore is path to keystore in my case.

You will get results like this.

enter image description here

Aamir Ali
  • 203
  • 1
  • 7
1

From the Android Developers documentation about Signing your app :

Expiry of the debug certificate

[...] The file is stored in the following locations:

  • ~/.android/ on OS X and Linux
  • C:\Documents and Settings\<user>\.android\ on Windows XP
  • C:\Users\<user>\.android\ on Windows Vista and Windows 7, 8, and 10
Community
  • 1
  • 1
flawyte
  • 7,678
  • 4
  • 44
  • 63
1

=======================================

in standart File Explorer:

=======================================

in standart File Explorer:

=======================================

open View tab and check Hidden items :

=======================================

open view tab and check Hidden

=======================================

Now you can see your .android folder

=======================================

Now you can see your .android folder

CodeToLife
  • 2,276
  • 2
  • 28
  • 21
1

[SOLVED] How I made my app run again after I had changed my username on same Windows 10 machine

In Android Studio, File > Project Structure > app > clicked “+” to add new configuration "config" File > Project Structure > app > Signing

In Flavors tab > Signing box, chose new "config" entry File > Project Structure > app > Flavors

This reconfigured the app. Closed & restarted Studio

Clicked Build > Rebuild Project

The app added and showed this automatically: build.gradle

When I tested the app on a cell phone, Studio asked to reinstall the app with this new configuration. App runs as before!

DynaMike

Blundell
  • 69,653
  • 29
  • 191
  • 215
Mike K
  • 11
  • 1
0

On Windows, if the debug.keystore file is not in the location (C:\Users\username\.android), the debug.keystore file may also be found in the location where you have installed Android Studio.

Bart Burg
  • 4,470
  • 7
  • 46
  • 81
0

The easiest thing I can think of is to grab the fingerprint from the debug.keystore (paths are mentioned in other answers) and add that to your project. No need to copy keystores or add new apps. Just append to the list of fingerprints for each machine you develop on.

FWIW, I ran into this when I switched from one laptop to another. I bounce around a lot.

https://support.google.com/firebase/answer/7000104?hl=en#sha1

Hope that helps some folks out! :)

BK-
  • 486
  • 7
  • 18
0

The default keystore file: debug.keystore is present in the folder .android which is usually located in the default home folder of your operating system of the user who installed that Android SDK.

In my Ubuntu PC, it's location is /home/dhananjay/.android

Whereas in the Windows PC it is located at C:\Users\dhananjay\.android

Dhananjay M
  • 1,691
  • 18
  • 17
0

Go to Build > Clean Project

Build your project again.

Ch3steR
  • 15,132
  • 4
  • 20
  • 45
0

In the case of Flutter you have to open the android part of the project only File->open->select the android folder of that project wait few minutes to complete the gradle sync after that on the right side click on the gradle->android->Tasks->android->signin Report

Suraj Jha
  • 89
  • 11