【问题标题】:CocoaPods build failing due to unresolved identifier由于未解析的标识符,CocoaPods 构建失败
【发布时间】:2015-09-07 19:40:21
【问题描述】:

我有一个使用 Obj-C cocoapods 的 swift 项目,但每当我构建时,由于 setBackgroundImageForStatesetImageForState 的标识符未解析而失败。

我的 Podfile 包含:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.1'

pod 'AFNetworking'

pod 'AnimatedGIFImageSerialization'

pod 'TTTAttributedLabel'

pod 'JTSImageViewController'

pod 'JSQMessagesViewController'

我已经运行pod install

我的桥接文件包含:

#import <AFNetworking/AFNetworking.h>
#import <AFNetworking/UIKit+AFNetworking.h>
#import "TTTAttributedLabel/TTTAttributedLabel.h"
#import "JTSImageViewController/JTSImageViewController.h"
#import <JSQMessagesViewController/JSQMessages.h>

并且在项目设置中正确链接。

知道为什么会这样吗?谢谢。

【问题讨论】:

  • 嗯,你检查导入失败的地方了吗?
  • @AlexBartiş 我不确定我明白你在问什么。这并不是说导入失败。我假设导入甚至从未发生过。
  • 是的,对不起,我写错了。我的意思是构建失败的地方。我看到那些是 AFNetworking 方法,所以我想 afnetworking 要么没有完全/正确安装,要么可能是构建目标有问题?您可以尝试使用此 github.com/kylef/cocoapods-deintegrate 插件来卸载所有 pod 并进行清理,然后重试在您的 pod 上运行 pod install。
  • @Wiz 出于好奇,您最终是如何解决这个问题的?

标签: objective-c swift cocoapods


【解决方案1】:

打开终端,cd 到你的Podfile 所在的目录:

] ls
...
Podfile

删除以前的安装:

] rm -rf Pods/ Podfile.lock

重新安装:

] pod install

Downloading dependencies
Installing AFNetworking (2.6.0)
Installing AnimatedGIFImageSerialization (0.2.0)
Installing JSQMessagesViewController (7.1.0)
Installing JSQSystemSoundPlayer (2.0.1)
Installing JTSImageViewController (1.4)
Installing TTTAttributedLabel (1.13.4)
Generating Pods project
Integrating client project

Xcode > 产品 > 清理构建文件夹(option-shift-command-K)。您可能还想删除派生数据以获得良好的度量(Xcode > Window > Projects > Delete)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-17
    • 2020-02-18
    • 2021-06-27
    • 1970-01-01
    • 1970-01-01
    • 2016-10-10
    • 1970-01-01
    相关资源
    最近更新 更多