I have a pod that depends on a static lib (precompiled, source code not available).
In this pod project, i drag and drop the folder containing the ".a" file and some other C, Obj-c files.
When i try to include this pod in an application, Cocoapods copy all that pod files but not the ".a" file.
In the Podspec, im using this to include the precompiled library to my pod
s.ios.vendored_frameworks = 'path/a_staticLib.a'
The line above copy the file in frameworks (Pods folder), this is normal as it is called "vendored_frameworks", but i can't found any solution to work with static library.
the error i have :
ld: framework not found -framework
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thank you.
CocoaPods pod-linkage plugin. In SwiftKey, we have a dynamic framework that we use to share code between the app and the keyboard extension, and all the pods are linked statically except for some of them that are linked dynamically because they are linked to the app and keyboard extension too.
After you have initially installed CocoaPods into your project, you can add new dependencies (or remove unused ones) by editing the Podfile. Then simply run pod install again.
Static and Dynamic Frameworks:Static frameworks contain a static library packaged with its resources. Dynamic frameworks contain the static/dynamic library with its resources. In addition to that, dynamic frameworks may conveniently include different versions of the same dynamic library in the same framework.
As said in CocoaPods Podspec documentation, you need to use vendored_libraries
for static libraries.
So this line:
s.ios.vendored_frameworks = 'path/a_staticLib.a'
should be:
s.ios.vendored_libraries = 'path/a_staticLib.a'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With