我遇到了一些麻烦.我正在尝试将Google Analytics安装到应用中,并始终使用未解析的标识符GGLContext和GAI错误.无论我是否使用CocoaPods,我都会收到同样的错误.错误的位置在AppDelegate.swift这里:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
var configureError:NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: \(configureError)")
// Optional: configure GAI options.
let gai = GAI.sharedInstance()
gai.trackUncaughtExceptions = true // report uncaught exceptions
return true
}
Run Code Online (Sandbox Code Playgroud)
没有任何其他内容可以导入AppDelegate.swift(例如Google),只是标准UIKit.
我经历了很多教程和其他SO问题,但都无济于事.我认为我遗失了一些小东西,却找不到它.
我做了什么:
我有.h文件,在我的项目,随着libGoogleAnalyticsServices.a,libsqlite3.0.tbd,libz.tbd,libsqlite3.tbd(所有这些都被链接到库以及CoreData和SystemConfiguration).
您可以在此处查看所有这些文件的布局:
和这里:
我创建-Bridging-Header.h并包含了这些.h …