使用未parsing的标识符'GMSServices'
我正在使用Xcode 7.1,部署目标是iOS 9.1。 该应用程序是“AreaCalculator”,它是用Swift编写的。 我没有按照以下步骤设置框架并导入地图:
-
$ sudo gem安装cocoapods
-
在“AreaCalculator”$ touch Podfile下
-
在Podfile中我把:
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '9.1' pod 'GoogleMaps'
-
$ pod安装
在terminal:
[!]无法加载插件规范
/Library/Ruby/Gems/2.0.0/gems/cocoapods-try-release-fix-0.1.2
更新本地规格库分析依赖项下载依赖项安装GoogleMaps(1.10.5)生成Pods项目集成客户端项目[!]从现在开始,请closures当前的Xcode会话并为此项目使用
AreaCalculator.xcworkspace
。 发送统计信息Pod安装完成! Podfile有1个依赖项,安装了1个完整的pod。 -
之后,我在导航器中select了AreaCalculator文件夹并selectFile \ New \ File …,然后selectiOS \ Source \ Objective-C文件模板并创build一个桥接文件:
“AreaCalculator桥接-Header.h”。- “#import GoogleMaps / GoogleMaps.h
-
然后在“与库链接二进制文件”中添加“GoogleMaps.framework”。 “GoogleMaps.framwork”和“”GoogleMaps.bundle“都在Pods文件夹中。
-
所有这些完成后,在AppDelegate.swift中,我把:
import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? let googleMapsApiKey = "MY_GOOGLE_IOS_API_KEY" func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. GMSServices.provideAPIKey(googleMapsApiKey) return true } }
但是,编译器向我展示了一个错误“使用未parsing的标识符”GMSServices“”。
我不知道我做错了什么? 任何人都可以帮忙
谢谢!
我已经通过在AppDelegate.swift中“导入GoogleMaps”来解决这个问题。
- Google Maps iOS SDK,获取2个位置之间的路线
- EXC_BAD_ACCESS使用在8.3设备上运行的gmaps sdk 1.9.0,Xcode 6.4
- GMSMapView清除方法不是去除GMSPolygon iOS吗?
- 无法使用iOS6.1 sdk为iOS版本1.7.0创buildGoogle Maps SDK
- 如何从GMSMapView中删除GMSPolygon
- GMSMapView myLocation不给实际的位置
- 如何将animation应用到GMSMarker
- 使用Google Maps iOS SDK 1.4设置mapView.delegate
- 如何在Google Map iOS SDK中获得特定的标记ID