Google api v2, I already have the key, however, provided by third parties, how to enable without SHA-1?

Asked

Viewed 203 times

2

I have a key to enable the Google Maps V2 on android, I did everything I had to do in Manifest and Gradle, when running the request, Fragment appears named Google, however, does not load anything, is in the color Beige clear, without anything on screen, however, the key I received bycompany mail, where it bought the license and sent me the key, I am new with Google Maps and realized that to generate the key it is necessary to have the SHA-1 from your PC that is developing, I am guiding myself by the book GOOGLE ANDROID 3rd edition publishing Novatec, and she explains that to access Google’s services through cloud.google.com I would need to access with a gmail account, but there is the doubt, I did not generate the key, so the SHA-1 will be different, and the gmail account wouldn’t have to be the person who bought the license?

The X the question is, since I have the key, how do I enable and make it work in my app???

Follow the image of how the App is:

Google Maps

  • I have the Client ID and SKU, this serves as some help?

  • 2

    If you are in a test environment, running the application directly from your IDE to your device, you should use a different key because the Keystore used is that of debug. For that key you received to work properly in production, you need to generate a APK of your app signed with the Keystore that gave rise to this key. Maybe this is what is missing for you.

  • I am running straight from the IDE, so should I use my email and generate a new key to continue development? When you talk on my app signed, ta talking about that subscription to put on Google Play (I never posted app on google play). I didn’t understand when you said Keystore that gave rise to this key , Keystore wouldn’t be the key already? (OBS: Sorry ignorance, I’m new in the android world)

  • 1

    Yes, for development you can use the Google console that generates the key using any account. When I say signed, it is because to generate a production APK, you need a file Keystore. The IDE does this automatically, but with the Keystore of debug. The archive Keystore has the SHA1 that is used for the Google console to generate a Maps key, that you put in Manifest. Take a look at in this my answer, see if it helps. Which IDE you use?

  • I just generated a new key by accessing the Google Console, I used the keytool -list -v -keystore c:\users\your_user_name\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android to take the SHA-1 and add my project, I generated the key... so far so good, now I used the new key generated by my SHA-1, but the same error, the same light beige screen, does not appear the map, I missed where? NOTE: I am using directly by the developing IDE.

  • 1

    That process of deleting the application, giving clean in the project and etc is important at this time. Did you do all this? I do not know what could be, the process is the same. Has some message on Logcat on the map?

  • Sorry for the mistake, I forgot a detail, I am working on the company network, I was being blocked by proxy, I changed network (A staff) and worked with this new key, now I will be able to work and develop, then just use the key I received (Purchased the business license) at the time of posting google play, correct? Other than that, it worked!

  • Yes, but to use that key, you need to sign your APK with the same Keystore that was used to generate that key. Someone who gave you this Google Maps key generated it from a Store, the same way you did.

  • OK @Paulorodrigues, I will be aware of this, I will ask this store to the user who sent me the key, I am extremely grateful for the help!

Show 4 more comments

1 answer

1


You can generate a key without SHA-1: enter console.developers.google.com and generate a new Googlemaps key. If you leave the key field blank, requests from any Android app will be accepted.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.