-1

I'd like to create an API key for my android app in the Google Developer Console.

Therefore i'll be asked for the sha1-fingerprint of my app. Google suggests me the following command line to get this fingerprint:

keytool -list -v -keystore mystore.keystore

This responded with an error:

$ keytool -list -v -keystore mystore.keystore keytool error: java.lang.Exception: Keystore file does not exist: mystore.keystore

So i try to find any keystore file in my project folder with "find"-command in terminal. Nowhere is a keystore file.

What should i do now?

delete
  • 18,144
  • 15
  • 48
  • 79
  • Your debug keystore is located at `$HOME/.android/debug.keystore`, where `$HOME` is your home directory. For release builds, your keystore is wherever you created it, as you create that keystore yourself. – CommonsWare Jan 03 '16 at 13:08
  • What is the real order to get a production api key? create keystore first (how?) or create the api key in google developer console first, which requires somewhat finger print? – delete Jan 03 '16 at 13:12
  • "create keystore first (how?)" -- using `keytool` or your IDE, following [the documented instructions](http://developer.android.com/tools/publishing/app-signing.html). – CommonsWare Jan 03 '16 at 13:26

2 Answers2

0

give a full path to where your .keystore file is.

keytool -list -v -keystore <path_to_your_keystore_file>/<you_keystore_file_name>.keystore

the .keystore file is, as the name suggests, what stores your app signing keys and this is what you sign your apk with. If you don't already have one create one.

To create a new keystore: Follow answers to this question.

Community
  • 1
  • 1
Viral Patel
  • 32,418
  • 18
  • 82
  • 110
0

Summarizing everything here.

To create a keystore, do the following in Android Studio (more here) :

  1. On the menu bar, click Build > Generate Signed APK.
  2. On the Generate Signed APK Wizard window, click Create new to create a new keystore.

To generate the SHA fingerprint do either of these:

keytool -list -v -keystore <FULL_PATH_TO_KEYSTORE>/<YOUR_KEYSTORE_NAME>.keystore

or

in your terminal, move to the directory where keystore file is present, then run this :

keytool -list -v -keystore <YOUR_KEYSTORE_NAME>.keystore
6ameDev
  • 46
  • 3