From @alloy originally submitted to CocoaPods/Core#58
This means that the framework should:
@rpath.FRAMEWORK_SEARCH_PATH for user targets (see this comment)Currently you have to do the following:
s.osx.vendored_framework = "PLCrashReporter-1.2-rc2/Mac OS X Framework/CrashReporter.framework"
s.osx.resource = "PLCrashReporter-1.2-rc2/Mac OS X Framework/CrashReporter.framework"
s.osx.xcconfig = { 'LD_RUNPATH_SEARCH_PATHS' => '@loader_path/../Frameworks' }
Related to:
This is (probably) less of an issue when we start using the user鈥檚 project to copy bundle resources, including frameworks?
@mrackwitz @neonichu is this still relevant?
Yes, there have been no changes to vendored_frameworks, as far as I know. BTW, we also need to check if the framework is dynamic at all, otherwise we will not be able to embed them.
@orta directed me to this issue. We're hitting a similar problem, where we now have a complete, pre-built dynamic framework on PSPDFKit and I can't figure out how to write a podspec for it. Basically all there should be in the spec is this:
s.ios.vendored_framework = "PSPDFKit.framework
The framework defines resources, headers and dependencies implicitly, so all cocoapod should do here is to copy it over (and strip irrelevant architectures).
@steipete Yah, it's not really supported, yet :cry: - you can try the workaround mentioned by Fabio above, but I am unsure if it'll work for iOS at all.
Can anyone help me with this error - In my private podspec, I am trying to specify my framework file
I use
s.ios.vendored_frameworks = 'MY_REPO/PATH_TO_FRAMEWORK/MyFramework.framework'
When I try to validate ths Spec, all I am getting is
- ERROR | [iOS] The vendored_frameworks pattern did not match any file.
Do I miss anything here?
Did anyone get this working on iOS? I'm having the same issue.
For iOS, the workaround by @fabiopelosin doesn't work for me. When embedding vendored frameworks using the s.resource attribute they will end up being embedded in the pod framework which isn't within the desired Frameworks path of the app. This will lead to issues when code signing the app during submission to app store.
@priteshshah1983 @sbhklr probably the best way to get this to work would just be to implement proper dynamic framework support for vendored frameworks -- a PR for that would be much appreciated :)
Hi eveyone,
Anything new since the past month, if we want to create a podspec embedding a vendored framework ?
I also experiment the same error with my podspec if I declare a vendored framework:
vendored_frameworks pattern did not match any file.With all the replies mentioned above, it's not quite clear if the problem was solved by anyone...
Thank you.
@ldi13: #3832 addresses _this issue here_, which appears on runtime, because dyld will complain about a missing binary.
But that's both not related to _your issue_. Could you please check whether the path to the specified vendored framework, you're specifying, isn't really just wrong. If that's the case, please open a new issue with more details.
@mrackwitz Hello Marius, thanks for your reply, actually, my path was wrong.
I was specifying the following path :
s.ios.vendored_frameworks = "${HOME}/frameworks/MyFramework.framework"
I changed the path and copy my framework directly into the Pods root:
s.ios.vendored_frameworks = "MyFramework.framework"
The warning is gone.
I guess it's not possible to specify an absolute path, the embedded vendored framework has to be shiped with the podspec.
If you have any other inputs regarding the way to specify a vendored framework, it would be great :-)
Thank you very much for the support.
So, with this implemented, does that mean that I can now have transitive dependencies on static libraries that have been turned into Cocoapods through use of vendored frameworks.
I'm thinking of Fabric/Crashlytics here.
No, Fabric/Crashlytics would need to transition their pods to vendoring dynamic frameworks instead of static libraries.
Is "transitive dependencies on static libraries" not possible at all, or just as of this latest bug chunk of fixes?
On that note, trying to figure out what to do in the interim as a lot of 3rd parties (Fabric, Firebase, Spotify, Rdio, etc-ad-infinitum) aren't shipping as dylibs... hack of just adding s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"${PODS_ROOT}/FMK_NAME"' } doesn't seem to work with frameworks enabled..
No, it's not possible at all.
Ooo that sucks. Good to know, thanks! Will have to start rallying for dynamic framework distribution..
Our app uses use_frameworks! (aka dynamic frameworks) for development & testing and use_frameworks!(false) (aka static libraries) when submitting to the App Store (due to lack of iOS 7 support).
We've split our app into a lot of parts/modules (using separate Pods for each) which are linked together by CocoaPods. These modules in turn use several static library Pods as transitive dependencies and they work for us even when all Pods are built as dynamic frameworks. But it requires various workarounds and there are some limitations.
Some Pods we're using as transitive dependencies are: Crashlytics, GoogleAnalytics, LayerKit
Some workarounds we're using:
xcconfig files using post_install hookpost_install hook-undefined dynamic_lookup linker flag FTWpre_install hookSo if you're not afraid of a lot hacky workarounds then using some static Pods as transitive dependencies should work.
Very interesting!
Unfortunately in this case, the pod that relies on another static pod, is written in Swift.. so dynamic it must be.
Our whole app and all its parts (which are Pods) are Swift and thus dynamic. Many of these dynamic Pods depend on static Pods.
This is not the correct issue to have this discussion on.
Mind pointing to the one that is? There's a lot of "vendored_frameworks" related issues.. a bit hard to navigate..
I have a framework I'd like to include in my pod, so that an app can link against it, but I don't need it embedded in the app bundle because it is installed on the device. It seems the new behaviour of vendored_frameworks is copying the framework into the bundle. Is there a way to have it not do that?
@malhal It's installed on the device? You mean it's an Apple framework? For Apple frameworks, you just use the s.frameworks property.
If it's not an Apple framework, then can you explain what you mean by "it is installed on the device"?
It's my own framework I distribute via a Cydia deb which installs it in \LibraryFrameworks. I have some developers that would like to build apps that link against it and it must run with the version on the device.
Please stop commenting on long-closed issues -- this isn't the proper place to have a discussion. Either open a new issue or ask on a more appropriate forum such as stack overflow. Thanks!
Hello,
Here my question is as i have uploaded zip to github repository and than what is the vendored_frameworks value i have to set so i can get framework from that.
Here i am totally confuse about is there embed zip and got framework from zip.
Most helpful comment
Can anyone help me with this error - In my private podspec, I am trying to specify my framework file
I use
s.ios.vendored_frameworks = 'MY_REPO/PATH_TO_FRAMEWORK/MyFramework.framework'When I try to validate ths Spec, all I am getting is
- ERROR | [iOS] Thevendored_frameworkspattern did not match any file.Do I miss anything here?