问题
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.
回答1:
As said in CocoaPods Podspec documentation, you need to use vendored_libraries
for static libraries.
So:
s.ios.vendored_frameworks = 'path/a_staticLib.a'
should be:
s.ios. vendored_libraries = 'path/a_staticLib.a'
来源:https://stackoverflow.com/questions/48504541/cocoapods-use-static-lib-into-a-pod