问题描述
我有一个iOS组件,它依赖于
以下是完整错误:
我正在使用Xcode 7.2和最新版本的Stripe SDK(6.0.0)。相同的Stripe框架代码在另一个项目中工作正常。
谢谢。
更新:我添加了 $(SRCROOT)/../ ..
(因为项目B在项目A内部居住了两个文件夹)到构建设置 - >搜索路径下的框架搜索路径项目B的目标,它开始成功编译。但是,我现在在运行时遇到此错误:
ld:警告:自动链接提供的'/ Users / rettig / wip / react-native-facebook-login.2 / Stripe.framework / Stripe',在/Users/rettig/wip/react-native-facebook-login.2/Stripe.framework/Stripe中的框架链接器选项不是dylib
体系结构x86_64的未定义符号:
_ OBJC_CLASS _ $ _ Stripe,引用自:
objc-class-ref in libRCTFBLogin.a(RCTFBLogin.o)
ld:symbol(s)not found for architecture x86_64
我必须做两件事才能得到这工作:
-
添加$(SRCROOT)/../ ..(因为项目B内部有两个文件夹项目A)到构建设置下的框架搜索路径 - >项目B目标的搜索路径。
-
将条带SDK添加到项目B的框架同样。第二步特别让我感到惊讶,因为Project B并不直接依赖Stripe。
I have an iOS component which relies on the Stripe iOS SDK, Project A. I included the Stripe SDK in Project A in Xcode and it compiles fine.
However, I'm building another project in Xcode which relies on this component, Project B. I added Project A to Project B's libraries. Project A relies on project B but does not rely directly on the Stripe SDK.
Now, whenever I try to compile Project B, I get this error:
ld: framework not found Stripe for architecture x86_64
This line (inside Project A) seems to trigger the error:
#import <Stripe/Stripe.h>
Xcode has no trouble finding Stripe.h
. I tried adding the Stripe SDK directly to Project B as well. I've double and triple-checked the Build Phases -> Link Binary With Libraries section for all targets (Stripe.framework
is listed).
I added the Stripe framework manually, so then I also tried adding it with Cocoapods instead, but that also didn't work.
Please help!
Here's the project structure for Project B ("example"), with Project A ("RCTFBLogin") below it.
Here's the full error:
I'm using Xcode 7.2 and the most recent version of the Stripe SDK (6.0.0). The same Stripe framework code works fine in another project.
Thanks.
Update: I added "$(SRCROOT)/../..
" (since Project B lives two folders deep inside Project A) to "Framework Search Paths" under Build Settings -> "Search Paths" for the Project B target and it began compiling successfully. However, I now get this error when running:
ld: warning: Auto-Linking supplied '/Users/rettig/wip/react-native-facebook-login.2/Stripe.framework/Stripe', framework linker option at /Users/rettig/wip/react-native-facebook-login.2/Stripe.framework/Stripe is not a dylib
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Stripe", referenced from:
objc-class-ref in libRCTFBLogin.a(RCTFBLogin.o)
ld: symbol(s) not found for architecture x86_64
I had to do two things to get this working:
Add "$(SRCROOT)/../.." (since Project B lives two folders deep inside Project A) to "Framework Search Paths" under Build Settings -> "Search Paths" for the Project B target.
Add the Stripe SDK to Project B's frameworks as well. This second step in particular surprised me because Project B does not rely directly upon Stripe.
这篇关于ld:找不到框架Stripe for architecture x86_64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!