Blank MapView on Android for Standalone After Publishing

#1

The MapView comes up entirely blank when I download it from the Play store.

It works running through the Expo app, it works on iOS, and it works when I download the .apk to my phone directly.

If I set my API key permissions to open, I’ve seen it work after a couple of hours. My suspicion is that it has something to do with a release/debug signing that I’m just not sure how to solve.

Any thoughts would be appreciated.

2 Likes
#2

Hey @goldeelocks

Could you confirm that you’ve followed the steps here for configuring google sign in? https://docs.expo.io/versions/latest/sdk/map-view.html#if-you-already-have-not-configured-google-sign-in

Let me know once you have.

#3

I can confirm that I’ve followed this. I’m currently starting the entire key signing process from the start to see if I just dropped something along the way.

1 Like
#4

I didn’t recall doing it, but I turned on Google App Signing (located under Release management). Obviously I had to grab their app signing certificate, and not the upload certificate.

1 Like
#5

Did this end up solving your problem? :smiley:

#6

It did! My MapView is now working as intended

#7

Praise the heavens! Thanks to @jesse for the tip :slight_smile:

#8

Hi @goldeelocks! I’m sorry, I’m also seeing my map blank in standalone app, I have enable Google App Signing, what did you do with the app signing certificate?

#10

For the app signature, you need to get your certificates. With Google Play, they can be found here:
image

You want to use this to grab the signature and head over to: https://console.developers.google.com/apis/ and go to credentials
image

Make your API key (or, if you have one up, just click into it for details)

At the bottom, there’s an option to “restrict the key” which you want to do. Add your package name and your SHA-1 certificate

You should have a key for iOS and a key for Android. This lets you apply your restrictions separately, and manage usage more strictly. Android requires these signatures, where iOS only needs the package name.

1 Like
#11

So, within my generated Api key in google Apis, I’ll not be using the SHA1 that I tooked from the apk using “keytool -list -printcert -jarfile …apk” (as expo says) and instead I need to use the SHA1 from App Signing?

#12

I would add both to your list of allowed certs.

keytool shows the fingerprint associated with the apk that was built by expo. When google signs the apk, it changes the fingerprint. I allow both, so that I have API access for my dev apk as well as the one downloaded from the play store

Google Maps on Android with MapView
#13

yippie kay yay!!! thanks a lot! that did the trick

1 Like
#14

Not working
I have generate my apk using my own keystore, generated SHA1 fingerprint, added them on api console in my key. Added the api key in app.json as per guidelines, still a blank Map in my production app.

#15

Are you using the key from before Google signs your app or after Google signs your app in the api?

#16

Thanks for this @goldeelocks, I added the key from play.google to my credential in console.developer and the map started to work on Android! :raised_hands:

2 Likes
#17

That solved my problem. Thanks!

1 Like
#18

your tips really helped me!!!

Expo need to change the documentation. in terminal the command copies the wrong SHA-1 certificate(the wrong one is the upload certificate but the right one is to grab it as you pasted above)

thank you! solve my problem!!!

#19

Hi @markmoo - sorry our docs are wrong :frowning_face: would you be able to point me to the place where we’re saying to copy the wrong SHA-1 certificate?

#20

I think his point is that, since many apps are signed by Google for security reasons, there should be a note about moving to production or something.

#21

https://docs.expo.io/versions/latest/sdk/map-view

Add your android.package from app.json (eg: ca.brentvatne.growlerprowler) to the Package name field.
Run exp fetch:android:hashes.
Copy Google Certificate Fingerprint from the output from step 9 and insert it in the “SHA-1 certificate fingerprint” field.