Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work for me #35

Closed
moscarar opened this issue May 26, 2018 · 13 comments
Closed

Doesn't work for me #35

moscarar opened this issue May 26, 2018 · 13 comments
Labels

Comments

@moscarar
Copy link

I followed the instructions on https://www.npmjs.com/package/@ionic-native/google-maps
but when I load my app I only see a grey box on it.
Steps
1-Installed npm install @ionic-native/core @ionic-native/google-maps
and then
2-I generated the key following the instructions on
https://github.com/ionic-team/ionic-native-google-maps/blob/master/documents/api_key/generate_api_key.md
3-then I executed
ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="my_key" --variable API_KEY_FOR_IOS="my_key"
4-After all of this
ionic cordova run android
But when the app load I only see a grey box.
Any help?
Thank you.

@wf9a5m75
Copy link
Contributor

wf9a5m75 commented May 26, 2018

Regenerate api key, then retry step4.

@msyahidin
Copy link

me too
dont work even with new key, grey box with google logo but no map loaded

@wf9a5m75
Copy link
Contributor

Gray map means your api key doesn't allow to use Google maps api or your app fingerprint is mismatch with restrictions. This is not bug, it's YOUR problem. Make sure everything.

@msyahidin
Copy link

after read carefully here, maybe this is the cause.

https://docs.google.com/presentation/d/1zlkmoSY4AzDJc_P4IqWLnzct41IqHyzGkLeyhlAxMDE/edit#slide=id.g39c2af405f_841_328

Even if you don’t register your payment after the grace period, Google Map in your app would be gray map or something. (I confirmed to Google)

will try it this afternoon or tomorrow
can we get a callback or error code to identified it?

@moscarar
Copy link
Author

moscarar commented May 28, 2018 via email

@wf9a5m75
Copy link
Contributor

Even after regenerating api key, I recommend you give up this plugin, and you use Google Maps JavaScript v3.

@wf9a5m75
Copy link
Contributor

ping

@msyahidin
Copy link

msyahidin commented May 30, 2018

added billing account
add SHA-1 certificate fingerprint
generate new key
check the api enabled

remove plugin
remove platform
add plugin and platform with new key, still not work

even test it on blank new project. not work still grey
i hope there is some error code show

please suggest me, what should i check again?

btw this is happen when updated to latest version, maybe last choice between downgrade or change to agm

@wf9a5m75
Copy link
Contributor

Remove the fingerprint.

@moscarar
Copy link
Author

moscarar commented May 30, 2018 via email

@mesutcakir
Copy link

I was working yesterday.

ionic cordova plugin rm cordova-plugin-googlemaps
ionic cordova platforms rm android

ionic cordova plugin add cordova-plugin-googlemaps
ionic cordova platforms add android

it worked fine.

@msyahidin
Copy link

I have found the problem,

just like @wf9a5m75 said before, it's because wrong API Key, but not the Key it self wrong.
I am sure inserted the right key.
But the documentation on page this slide https://docs.google.com/presentation/d/1zlkmoSY4AzDJc_P4IqWLnzct41IqHyzGkLeyhlAxMDE/edit#slide=id.g282d0a7bfd_0_107
THIS IS WRONG (DO NOT COPY FROM THERE)
$> ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID=”.....” --variable API_KEY_FOR_IOS=”.....”

it contain wrong cli format or typo on double quote, it's not quote but like apostrophe.
If you copy the command to the terminal then insert the key, the command will produce this line on config.xml :
<variable name="API_KEY_FOR_ANDROID" value="”KEY”" />

package.json:

"cordova-plugin-googlemaps": {
"API_KEY_FOR_ANDROID": "”ANDROID_KEY”",
"API_KEY_FOR_IOS": "”IOS_KEY”",
"PLAY_SERVICES_VERSION": "15.0.1",
"ANDROID_SUPPORT_V4_VERSION": "26.1.0",
"LOCATION_WHEN_IN_USE_DESCRIPTION": "This app wants to get your location while this app runs only.",
"LOCATION_ALWAYS_USAGE_DESCRIPTION": "This app wants to get your location always, even this app runs in background."
}

And then make your API Key wrong.
Hope the ionic team fix the typo cli command on the documentation. Btw it's nice docs.

@moscarar are you following the documentation in google docs? check your package.json and config.xml, is it the right key?

  1. remove plugin
  2. remove platform
  3. add plugin with the right command (make sure it's NOT apostrophe)
  4. add platform

@wf9a5m75
Copy link
Contributor

I believe general programmer understand <variable name="API_KEY_FOR_ANDROID" value="”KEY”" /> is wrong without thinking.

Anyway, congrats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants