相关疑难解决方法(0)

使用未解析的标识符GGLContext和GAI

我遇到了一些麻烦.我正在尝试将Google Analytics安装到应用中,并始终使用未解析的标识符GGLContextGAI错误.无论我是否使用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 …

xcode google-analytics swift swift2

25
推荐指数
4
解决办法
1万
查看次数

在ios swift中实施Google Analytics

我正在关注iOS版Analytics(developers.google.com/analytics/devguides/collection/ios/v3/?ver=swift)指南,我在Swift代码项目中遇到了无法修复的错误.我正在使用XCode 6.4,Swift和iOS部署目标8.1.

步骤1

首先,我使用CocoaPods安装了Google SDK.这是运行pod install命令后的控制台结果:

Updating local specs repositories

CocoaPods 1.0.0.beta.2 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Analyzing dependencies
Downloading dependencies
Using Google (1.0.7)
Using GoogleAnalytics (3.14.0)
Using GoogleNetworkingUtilities (1.0.0)
Using GoogleSymbolUtilities (1.0.3)
Using GoogleUtilities (1.1.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency …
Run Code Online (Sandbox Code Playgroud)

google-analytics ios swift

11
推荐指数
3
解决办法
1万
查看次数

标签 统计

google-analytics ×2

swift ×2

ios ×1

swift2 ×1

xcode ×1