GMSMapView不显示xcode调试会话外的图块
问题描述:
我正在使用GoogleMaps iOS SDK(版本2.1.1),我正在使用GMSMapView来显示地图。在应用中:didFinishLaunchingWithOptions:GMSMapView不显示xcode调试会话外的图块
GMSServices.provideAPIKey( “钥匙”)
其中:
- 关键是要从https://console.developers.google.com
- 谷歌地图SDK关键的GMS API是通过调用初始化对于iOS已启用https://console.developers.google.com
当我从Xcode运行应用程序时,地图显示精细d所有地图相关功能(包括显示地图图块)按预期工作(在模拟器和设备上)。但是,一旦Xcode调试会话终止,地图图块不可见(GMSMapView为空)。
我尝试使用不同的值(例如 无,iOS应用程序(指定应用程序的包ID))配置密钥(密钥限制),但没有任何区别。一旦调试会话终止显示。
答
我的团队用数据表现的框架我们写包裹谷歌地图SDK经历了类似的问题。
最初我们链接我们CoreApplication,我们CoreLibrary,以及我们对谷歌MapFramework这样的地图:
供参考,这是我们原来破 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
我们也花了很多的时间尝试各种有关钥匙的事情,代码签名,甚至改变我们的方式实例化GMSMapView。
对我们来说,解决方案就是不要将我们的CoreFramework与GoogleMaps链接起来。
我们更新工作 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