[英]Embedded swift framework with cocoapods
I made a private framework that I want to use in different project. 我创建了一个私有框架,我想在不同的项目中使用它。 I use Cocoapods with this framework for third parties like AFNetworking, Facebook, or SDWebImage.
我将Cocoapods与此框架一起用于第三方,如AFNetworking,Facebook或SDWebImage。 I use an aggregate to build my framework for simulator and devices architectures.
我使用聚合来构建我的模拟器和设备架构框架。
I can build it, without any problem, but when I add my embedded framework to my new project (wrote in Objective-C), I have this error at the launch: 我可以毫无问题地构建它,但是当我将嵌入式框架添加到我的新项目中时(在Objective-C中编写),我在启动时遇到了这个错误:
dyld: Library not loaded: @rpath/AFNetworking.framework/AFNetworking
Referenced from: /private/var/containers/Bundle/Application/2BE49976-94F8-43C3-BBFF-930F11642DDE/MyPhotoApp.app/Frameworks/PhotoLibrary.framework/PhotoLibrary
Reason: image not found
My new project has also Cocoapods with all the required pods of my framework. 我的新项目还有Cocoapods,包含我框架所需的所有pod。
The thing I would like, and I can't find how to do it, is to make a framework that depends of Cocoapods, but that does not contains the sources. 我想要的东西,我找不到如何做,就是建立一个依赖于Cocoapods的框架,但这不包含源代码。 I would like that the client add itself the necessary pods to its project.
我希望客户端为其项目添加必要的pod。
Do you know how I can do that ? 你知道我怎么做吗?
Thank you :) 谢谢 :)
For Objective-c
projects, DONOT uncomment the line use_frameworks!
对于
Objective-c
项目, DONOT取消注释use_frameworks!
行use_frameworks!
. 。 It is meant only for swift projects.
它仅适用于快速项目。 For future reference.
备查。 :)
:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.