0

when i test my app,it shows map.But after i published on play store the map is not showing.i followed this steps to generate the SHA1 key.Then I generated google maps API key with package name and sha1 key.Then i pasted that key in google maps API.xml but the map is not showing after i publish.i am new to android .any help

Community
  • 1
  • 1
shyamyy
  • 29
  • 3
  • you need to create two key store 1.debug.keystore(for debug),2.release.keystore (for publish application) .When you create sign apk that time select release.keystore. – Kintan Patel Nov 25 '16 at 07:16
  • You have to one more sha key for release with your release keystore – Prasanna Anbazhagan Nov 25 '16 at 07:16
  • Make sure you have generated SHA for release keystore – Piyush Nov 25 '16 at 07:17
  • thank you all for ur replies. i m new to android.can u refer some link how to create seperate keystore for debug and release.i had searched so many answers and got confused which method to use. – shyamyy Nov 25 '16 at 08:48

1 Answers1

0

You may follow this tutorial. It is based on this documentation: Sign Your App.

To generate keystores for signing Android apps at the command line, use:

$ keytool -genkey -v -keystore my-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

To create a debug keystore, use:

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
  • Keystore name: "debug.keystore"
  • Keystore password: "android"
  • Key alias: "androiddebugkey"
  • Key password: "android"
  • CN: "CN=Android Debug,O=Android,C=US"

For your release keystore, do the same as above but choose a name, alias, and password that you prefer.

ANOTHER step is to use Android Studio to manually generate signed APKs, either one at a time, or for multiple build variants at once.

To manually sign your APK for release in Android Studio, follow these steps:

  1. In the menu bar, click Build > Generate Signed APK.
  2. Select the module you would like to release from the drop down, and click Next.
  3. If you already have a keystore, go to step 5. If you want to create a new keystore, click Create new.
  4. On the New Key Store window, provide the following information for your keystore and key.

    • Keystore
      • Key store path: Select the location where your keystore should be created.
      • Password: Create and confirm a secure password for your keystore.
    • Key
      • Alias: Enter an identifying name for your key.
      • Password: Create and confirm a secure password for your key. This should be different from the password you chose for your keystore
      • Validity (years): Set the length of time in years that your key will be valid. Your key should be valid for at least 25 years, so you can sign app updates with the same key through the lifespan of your app.
      • Certificate: Enter some information about yourself for your certificate. This information is not displayed in your app, but is included in your certificate as part of the APK.

    Once you complete the form, click OK.

  5. On the Generate Signed APK Wizard window, select a keystore, a private key, and enter the passwords for both. (If you created your keystore in the last step, these fields are already populated for you.) Then click Next.

  6. On the next window, select a destination for the signed APK(s), select the build type, (if applicable) choose the product flavor(s), and click Finish.

When the process completes, you will find your signed APK in the destination folder you selected above.

For more information, you can check the documentation. Hope this helps!

abielita
  • 13,147
  • 2
  • 17
  • 59
  • thank you lot....i understand now .i created a release keystore.Now i want to add a google maps api key and publish in playstore?i already tried this and published bt the map is not showing after publish.so,can u tell me any idea? – shyamyy Nov 28 '16 at 12:36
  • You may follow [this](http://stackoverflow.com/a/18982638/5832311) and [this](http://stackoverflow.com/a/2362930/5832311). *"The Google Maps API key is tied to the keystore you use to sign the app, so there is one Maps API key that you use when you sign with the debug keystore (i.e., normal development) and one Maps API key that you use when you sign with the production keystore (i.e., going to Market)."* – abielita Nov 28 '16 at 12:43
  • i hav followed that steps and created.Now i want to check that its working properly or not,before publishing.how to check that map will work corectly for release mode before publishing? – shyamyy Nov 28 '16 at 15:03
  • I guess you can check it the way you test the debug-signed APK. – abielita Nov 29 '16 at 12:02