CocoaPods: use static lib into a pod

£可爱£侵袭症+ 提交于 2020-12-05 11:00:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!