本地CocoaPods Pod编译错误 [英] Compiling error with local CocoaPods pod

查看:124
本文介绍了本地CocoaPods Pod编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,该应用程序通过CocoaPods使用外部库,例如AFNetworking,ReactiveCocoa等,以及一个我之前编写的静态库。静态库还包含来自CocoaPods的一些外部库。

I'm writing an app that using external libraries through CocoaPods such as AFNetworking, ReactiveCocoa etc, and one static library that I wrote before. The static library also contains some external libraries from CocoaPods as well.

我已将静态库设为CocoaPods的本地容器,并将其导入为我的容器之一。

I've made my static library an local pod of CocoaPods and imported it as one of my pods.

但是,在编译我的新应用程序时,发生了错误。

However, while compiling my new app, error happened.

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_YADAClientManager", referenced from:
  objc-class-ref in DZPAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

YADAClientManager 是我的静态库的一类,在我的新应用中使用它的唯一代码是在DZPAppDelegate.m中的application:didFinishLaunchingWithOptions:

YADAClientManager is one class of my static library, and the only code that using it in my new app is in the DZPAppDelegate.m, in application:didFinishLaunchingWithOptions:

[YADAClientManager sharedClientManager];

如何解决此编译错误?并提前谢谢。

How to solve this compiling error? And thanks in advance.

编辑:

在我的构建词组中应用程序的目标 Link Binary With Libraries 选项中,我添加了静态库的* .a文件,例如 libPods-MyApp-MyStaticLibrary.a ,以上问题已解决但是出现了另一个问题,报告缺少 AFNetworking ReactiveCocoa 符号。

In the Build Phrase of my app target, the Link Binary With Libraries option, I added the *.a file of my static library, such as libPods-MyApp-MyStaticLibrary.a, the problem above solved but another problem that reported missing AFNetworking and ReactiveCocoa symbols appeared.

在我添加了这些库的* .a文件之后,问题解决了。

After I added the *.a files of those libraries, problem solved.

但是我认为这不是解决问题的一种优雅方法。

But I do not think it is an elegant way to solve the problem.

推荐答案

我遇到了类似的问题:
修改后的Pod无法编译

I was running into a similar issue: Modified Pod not getting compiled

我设法找出Pod的源文件和静态库(.a)缓存在以下路径中:

I managed to find out that my Pod's source files and static library (.a) were cached in this path:

/ Users /'<'username'>'/ Library / Developer / Xcode / DerivedData / Example-gdaxkniovwphxbdlndbmlfqn / Build / Products / Debug-iphoneos

/Users/'<'username'>'/Library/Developer/Xcode/DerivedData/Example-gdaxkniovwphxbdlndbmlfqn/Build/Products/Debug-iphoneos

目标的构建设置>搜索路径>框架搜索路径中也提到了此路径。 >
我删除了那些缓存的文件,并使用新的符号重新构建了Pod。花了我2天时间进行调试。

This path is also mentioned in your Target's : "Build Settings"> "Search Paths" > "Framework Search Paths".
I removed those cached files and my Pod was re-built with the new symbols. Took me 2 days to debug.

这篇关于本地CocoaPods Pod编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆