【问题标题】:Adding Google_analytics for iOS is not working tried many ways?为 iOS 添加 Google_analytics 不起作用尝试了多种方法?
【发布时间】:2014-11-09 18:56:39
【问题描述】:

您好,我收到以下错误,目前无法修复。

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GAI", referenced from:
  objc-class-ref in AppDelegate.o objc-class-ref in HomeViewController.o  "_OBJC_CLASS_$_GAITrackedViewController", referenced from: _OBJC_CLASS_$_HomeViewController in HomeViewController.o "_OBJC_METACLASS_$_GAITrackedViewController", referenced from: _OBJC_METACLASS_$_HomeViewController in HomeViewController.o ld: symbol(s) not found for architecture x86_64

任何帮助将不胜感激。提前致谢 !

【问题讨论】:

  • 您使用的是什么版本的 Google Analytics SDK?
  • 嗨 GenieWante 我正在使用 GoogleAnalyticsServicesiOS_3.09
  • 你被导入了 lib.sqlite3.0 文件
  • 是的 Anbu.Karthik 我已经导入了 lib.sqlite3.0 文件
  • FWIW,为自己省去一个麻烦,只需更改为 parse.com 进行分析。简单得可笑。

标签: ios architecture undefined analytics symbols


【解决方案1】:

对我来说,问题是通过以下步骤解决的:

pod init

打开 Podfile 粘贴以下行(将 Projectname 更改为您的项目名称)

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'Projectname' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!


  # Pods for Projectname
  pod 'GoogleAnalytics'

  target 'ProjectnameTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ProjectnameTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

【讨论】:

    【解决方案2】:

    在我将libGoogleAnalyticsServices.alibsqlite3.0.dylib 添加到“Link Binary with Libraries”之前遇到了同样的问题

    这是我的完整列表:

    【讨论】:

      【解决方案3】:

      这里的建议对我有用,可以同时添加 libGoogleAnalyticsServices.a 和 libsqlite3.0.dylib。我正在构建一个快速项目,如果我有特权,我会投票赞成答案 1。

      【讨论】:

        【解决方案4】:

        我已尝试重现您一直面临的问题,但最终还是遇到了同样的错误。但是,我能够修复它。我所做的是,我已将 SDK 文件夹中的文件 libGoogleAnalyticsServices.a 添加到我的项目中。然后,我将libsqlite3.0.dylib 添加到Build Phases 选项卡中的Link Binary With Libraries。成功了!!!!

        PS:确保您已在项目中添加了所有标题和提到的框架。关键是要包括libGoogleAnalyticsServices.alibsqlite3.0.dylib

        【讨论】:

        • 嗨精灵,我已经完成了相同的过程,但我无法解决问题。
        • 好吧 nanbaa.. 您是否使用 Link Binary With Libraries 部分中添加的 libGoogleAnalyticsServices.a 文件?
        • 是的。我用过 libGoogleAnalyticsServices.a
        猜你喜欢
        • 2019-09-25
        • 2023-03-31
        • 2023-01-28
        • 2018-05-09
        • 1970-01-01
        • 2020-09-22
        • 1970-01-01
        • 2021-05-21
        • 2022-08-03
        相关资源
        最近更新 更多