ios - Cocoapods 谷歌分析 ld : framework not found Pods

标签 ios swift google-analytics cocoapods

我在使用 CocoaPods 时遇到问题,收到此错误:

ld: framework not found Pods clang: error: linker command failed with exit code 1 (use -v to see invocation)

我正在尝试安装 Google Analytics,我做了什么?:

  • 我安装了 CococaPods
  • 已编辑的 PodFile
  • 安装了库

Podfile:

platform :ios, "9.0"

use_frameworks!

pod 'Google/Analytics'

target 'Solutis' do

end

target 'SolutisTests' do

end

谷歌分析代码:

        var tracker = GAI.sharedInstance().defaultTracker
        tracker.set(kGAIScreenName, value: "test")

        var builder = GAIDictionaryBuilder.createScreenView().build() as! [NSObject : AnyObject]
        tracker.send(builder)
//        tracker.send(GAIDictionaryBuilder.createEventWithCategory("test", action: "test", label: "test", value: nil).build())

        let eventTracker: NSObject = GAIDictionaryBuilder.createEventWithCategory(
            "SomeCategory",
            action: "SomeAction",
            label: "SomeLabel",
            value: nil).build()
        tracker.send(eventTracker as! [NSObject : AnyObject])

Solutis-Bridging-Header.h:

//
//  Solutis-Bridging-Header.h
//  Solutis
//
//  Created by informatique Responis on 07/01/2016.
//  Copyright © 2016 Solutis. All rights reserved.
//

#ifndef Solutis_Bridging_Header_h
#define Solutis_Bridging_Header_h

#import <Google/Analytics.h>


#endif /* Solutis_Bridging_Header_h */

在build设置中添加了此文件

我做到了:

pod install命令

但是我收到错误,我想我在 pod 的文件夹安装上犯了一个错误,我在项目的根目录中:我想我必须进入 swift 文件所在的文件夹,不是吗?我不想再做错误的事情...如果我犯了这个错误,如何删除根目录中的 pod 安装和库?

管理方案:

enter image description here

最佳答案

进入管理方案,在 pod 上勾选标记 - 您的项目名称,选择该方案,构建项目一次,应该可以解决它。

关于ios - Cocoapods 谷歌分析 ld : framework not found Pods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34673493/

相关文章:

javascript - Gatsbyjs + Google Analytics - 跟踪自定义事件?

ios - 使用 UIAppearance 使 UINavigationBar 具有渐变背景

ios - 试图让静态 3D 触摸快速操作在 Obj-C 中工作

javascript - 基于 JavaScript 的跨平台移动应用程序分析

swift - 向 MKAnnotation 添加属性会出现 EXC_BAD_EXCESS 错误

ios - UITextfield 在编辑模式下从顶部被剪切

elasticsearch - 是否有可能提取 Google Analytics 数据并将其发布到 Elastic Search?

javascript - 使用 cordova 编译 iOS 版本时出现问题

ios - 使用 AFNetworking 下载图像 - 使用 ARC 弹出 ViewController 后内存不会释放

ios - 同一 View (从可 ScrollView 中拖动 View )上的多个手势无法正常工作?