GMSMapView not showing tiles outside of xcode debug session

374 views Asked by At

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:

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.

1

There are 1 answers

0
Nick Fox On

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:

enter image description here

For reference, here is our original broken Podfile:

# Global platform for the project.
platform :ios, '8.0'

use_frameworks!

source 'https://github.com/CocoaPods/Specs.git'

workspace 'Comprehensive.xcworkspace'

target 'OurApplication' do
  pod 'Alamofire', '~> 3.5.1'
  pod 'GoogleMaps', '~> 1.13.2'
  #other pods

  project '../some/path/OurApplication.xcodeproj'
end


target 'CoreFramework' do
  pod 'GoogleMaps', '~> 1.13.2'
  #other pods

  project '../some/path/CoreFramework.xcodeproj'
end


target 'MapFramework' do
  pod 'GoogleMaps', '~> 1.13.2'    

  project '../some/path/MapFramework.xcodeproj'
end

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:

# Global platform for the project.
platform :ios, '8.0'

use_frameworks!

source 'https://github.com/CocoaPods/Specs.git'

workspace 'Comprehensive.xcworkspace'

target 'OurApplication' do
  pod 'Alamofire', '~> 3.5.1'
  pod 'GoogleMaps', '~> 1.13.2'
  #other pods

  project '../some/path/OurApplication.xcodeproj'
end


target 'CoreFramework' do
  #other pods

  project '../some/path/CoreFramework.xcodeproj'
end


target 'MapFramework' do
  pod 'GoogleMaps', '~> 1.13.2'    

  project '../some/path/MapFramework.xcodeproj'
end