I'm trying to use the Google Maps API in one of my projects and in the directions to set up the API credentials it wants me to add my application's SHA-1 signing-certificate fingerprint to the API.
In the instructions, it says to use the following command to get the fingerprint:
keytool -list -v -keystore mystore.keystore
When I try to use it, both in the Android Studio terminal as well as cmd prompt in my application's directory I get the following error:
keytool error: java.lang.Exception: Keystore file does not exist: C:\Users\Name\.keystore
Note, my application is in D:\Projects\Android\AppName.
How do I get my SHA-1 signing-certificate to use with the Google Maps API?
The default location is /Users/<username>/. android/debug. keystore.
After clicking on the app, Navigate to Tasks. Inside Tasks, navigate to “android” and double click on the signing report option. After clicking on this option you will get to see the path for your debug. keystore file.
The easiest way of find the SHA-1 of your Android application is as follows: (NOTE: can only be done in Android Studio)
1) Open your project
2) Click on the 'Gradle' tab in the right hand corner of the android studio window
3) If no content is being shown click on the "Refresh all Gradle projects" icon in the left corner of the Gradle window (the blue icon)
4) From the contents select the one that has your project name
5) Go to 'Tasks' -> 'android' -> 'signingReport'
6) It will open a console, click the 'Toggle tasks executions/text mode' icon in the left top corner of it
Now you will be able to see your SHA-1 information along with a bunch of other information about your project in the console
This link contains an image that highlights the above stated steps
After checking this make sure to change your configuration module to your current project. To do this follow the below steps:
1)Click on the'select Run/Debug configuration' drop-down
2) Select app
3)Click on the'select Run/Debug configuration' drop-down again and select edit configurations
4)Select the 'General' tab and change the 'Module' to 'app', also tick the 'activate tool window' checkbox
5) press 'ok'
now you can run your project like before by pressing on the run button.
This link contains an image that highlights the above stated steps
hope this helped.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With