ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

Map is not visisble in android builds. Works fine on browser. Android deviced just shows a peach background with google writen on it #242

Closed imanzal closed 4 years ago

imanzal commented 4 years ago

I'm submitting a ... (check one with "x")

If you choose 'problem or bug report', please select OS: (check one with "x")

cordova information: (run $> cordova plugin list)

insert the output from the command here

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

Current behavior:

Expected behavior:

Screen capture or video record:

Related code, data or error log (please format your code or data):

The person who share your project files on Github (or other git repository) is in faster lane than other people.
Please share your project files on Github or others(Bitbucket, Gitlabs...etc).
If you don't want to share your project files, please create a demo project, then share it.

Screen captures, and/or native logs(such as Logcat, xcode logs) are appreciate.

Giving much information, you are waiting time is less.
Thank you for your cooperation.
imanzal commented 4 years ago

photo_2019-08-14_13-59-06

battika commented 4 years ago

If you can see the Google Logo it means the plugin is working. You have a problem with your Android API key. Probably you tied the key to your application package name, which will only work when you sign the app. Try making a production build, sign it and check if it works. I bet it will. If you want to see the map development time I suggest you create a development-only API key not restricted to the package name but you should never release your app with this key.

imanzal commented 4 years ago

Thanks for the reply. I've used the same API key for some of my other apps which was built in ionic 4 and ionic-native/core version lesser than or equal to 5.0.0. When I built this app in ionic@5, this issue was happened. I tried downgrading ionic-native/core to 5.0.0 and ionic-native/google-maps to 5.0.0-beta.27. Now it works fine. So I'm in doubt that is it an issue with latest ionic or the with the latest google map plugin.

Also I don't remember binding the key to an application package. Kindly let me know how its done.

ndrake commented 4 years ago

This kinda looks like the issue mentioned here:

https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/troubleshootings/graymap/README.md

You secure the API keys in the Google Cloud Platform console: https://cloud.google.com/docs/authentication/api-keys#api_key_restrictions