0
votes

When calling plugin.google.maps.Map.getMap I don't see the map being shown.
Remote inspection with Chrome reveals there's an error in the browser console: getMap is not defined in GoogleMaps plugin

I followed all steps mentioned in the pluing's tutorial for Linux: https://github.com/mapsplugin/cordova-plugin-googlemaps/wiki/Tutorial-for-Mac

I have installed all the required Android packages, made sure my API key is correct, that the Google maps services are enabled and everything else mentioned in the troubleshooting guide.

Versions:
Cordova: 5.4.1
Googlemaps plugin: 1.3.9
Android emulator: Nexus 5 with 5.1.1 (API level 22)

I'm a noob with Cordova and Android platforms, so no idea where to go from here, how to get past this error.

1
Try invoking getMap() with no options... - Hackerman
Thanks, I had tried both with and without options, same thing. - SergiuB

1 Answers

1
votes

Ok, so I got around it.
It turns out there's a recent issue with Google Play Services: https://code.google.com/p/gmaps-api-issues/issues/detail?id=9021 (found it googling the Java exception I found with adb logcat)

The comment that helped me is this one:

"We have identified the issue and have developed a fix. It will be rolling out in the next major update of Google Play Services, but at this stage we don't have a timeline just yet. (It will be soon!) If you are using an emulator, re-creating the instance (possibly with a new SD card attached) should work around the problem. Thanks for the patience, everyone! We will let you know when the fix has rolled out. (Make sure to 'star' the issue to be notified of updates.)"

Looks like it tries to write something on the SD card, and I had not set any size for SD in the emulator.
Once I set SD size to 200MB in my AVD, and restarted the emulator, everything worked fine. This seems to be the workaround until the new Google Play Services version with the right fix comes out.