0

I link this 2 log in api with my app and it is already done in debug mode(connect my phone with my computer and press run). When I build apk and put it to my phone and run , it doesn't work like in debug mode.

It alerts that 1. windows excption index out of bound 2. hash key doesn't match (google result error code: 10)

I think the first problem isn't the true problem. I think the second is the problem so I go to see the SHA-1 on my computer. It's a match with SHA-1 in developergoogle.

I run app in debug mode.

It works well. The result of google api is error code:0 (not error)

Can anyone tell me what this problem is and how to solve it ?

Hans1984
  • 796
  • 11
  • 24
YY.theFenix
  • 25
  • 1
  • 3
  • 1
    are you using signed apk? – Andy Developer Jul 12 '17 at 11:03
  • 1
    I think you are using the debug keystore sha1 thats why it is working only in debug mode. – Andy Developer Jul 12 '17 at 11:04
  • @AndyDeveloper yes i build "Generate signed APK", Oh how can i get the keystore sha-1 which can use in signed apk mode or both debug mode and apk mode? – YY.theFenix Jul 12 '17 at 13:49
  • You need to create your own keystore when you release the application. If the apk is already in the google playstore follow [this](https://stackoverflow.com/questions/44671778/published-app-on-play-store-cant-communicate-with-google-maps-api-and-facebook/44672565#44672565) and [this](https://stackoverflow.com/questions/44668322/google-map-not-showing-when-app-is-downloaded-from-playstore-but-showing-fine-wh/44672526#44672526) question where I already answer if you publish the apk on playstore. – Andy Developer Jul 12 '17 at 13:54
  • You can [follow this](https://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore) if you want to create a keystore file. – Andy Developer Jul 12 '17 at 13:55
  • 1
    @AndyDeveloper thank you it's work. :) – YY.theFenix Jul 19 '17 at 04:29
  • welcome sir : ) – Andy Developer Jul 19 '17 at 04:59
  • see my answer you can accept my answer if you think it helps you so other can found this post helpful. – Andy Developer Jul 19 '17 at 05:02

1 Answers1

0

Here is the answer for why you can't see the Google Map.

I recently Upload the APK on Google Play store and I faced the same issue after checking the Play Console I found the solution for this problem.

Their is no problem with your key but the problem is with your SHA-1. You signed your APK with your SHA-1 that is fine and then upload the APK it also fine.

But as per the new update for Play Console when you signed your APK with SHA-1 and upload the APK it only signed by you but as per the new update it is also signed by Google Play for more security. Have a look here some part of Google Play section:

With Google Play App Signing: You sign your app with your upload key. Then, Google verifies and removes the upload key signature. Finally, Google re-signs the app with the original app signing key you provided and delivers your app to the user.

You can refer Documentation here.

Now, The Answer of your question is After successfully upload the APK you can see that in the section with Two SHA-1 the 1st SHA-1 is Google created its own and 2nd SHA-1 is its yours.

So just copy the Google SHA-1 and paste it to your console where you generate the Google Map API Key.

How to create a keystore? You can refer this.

Andy Developer
  • 3,071
  • 1
  • 19
  • 39