I am using GoogleMaps iOS SDK (version 2.1.1) and I am using GMSMapView to display a map. On application:didFinishLaunchingWithOptions: the GMS api is initialized by calling:
GMSServices.provideAPIKey("key")
where:
- key is the key from https://console.developers.google.com
- the Google Maps SDK for iOS is enabled on https://console.developers.google.com
When I run the app from Xcode the map is displayed fine and all map related functionality (including showing map tiles) works as expected (on both simulator and device). However, once the Xcode debug session is terminated the map tiles are not visible (the GMSMapView is empty).
I tried configuring the key (Key restriction) with different values (e.g. None, iOS APPS (specified app's bundle id) but nothing makes a difference. The map tiles are displayed fine while in xcode debug session but they are not displayed once the debug session is terminated.
My team experienced a similar issue using a data presentation framework we wrote wrapping the Google Maps SDK.
Initially we were linking our CoreApplication, our CoreLibrary, and our MapFramework against Google maps like this:
For reference, here is our original broken Podfile:
We also spent a lot of time trying a variety of things related to keys, code signing, and even altering the way we instantiated the GMSMapView.
The solution for us was to simply not link our CoreFramework against GoogleMaps.
Our updated working Podfile: