Note that there are some explanatory texts on larger screens.

plurals
  1. POCocoapods podspec issue
    primarykey
    data
    text
    <p>I've been in the process of refactoring some code and have created a static library that I'm now using in a framework that is used in a few apps. I'm using cocoapods and am having trouble properly integrating my new static library into the podspec.</p> <p>I'm finding that builds are failing because the static library is missing from the build. If I manually add the static library to the final app, the framework and app work fine. A build team generates the final releases of the apps, and because of this I've only been responsible for update the podspec for the framework only. </p> <p>Is it possible for me to modify the pod spec to set the static library as a linked library that shows up under build phases of the final app?</p> <p>UPDATE:</p> <p>When adding the static lib to the framework.library attribute of my sub spec I'm getting <code>library not found for -lMyStaticLib</code></p> <p>SUBSPEC FOR REFERENCE:</p> <pre><code> s.subspec 'MyStaticLibrary' do |msl| mss.source_files = 'FrameworkSource/My-Static-Library/*.{h,a}' msl.library = 'MyStaticLib' msl.xcconfig = { 'HEADER_SEARCH_PATHS' =&gt; '"$(SRCROOT)/Pods/My-Framework-Name/FrameworkSource/My-Static-Library"/**', 'LIBRARY_SEARCH_PATHS' =&gt; '"$(SRCROOT)/Pods/My-Framework-Name/FrameworkSource/My-Static-Library"/**' } #msl.frameworks = 'MyStaticLib' end </code></pre> <p>UPDATE 2: I changed the attribute to <code>msl.vendored_libraries = 'MyStaticLib'</code> Also validated paths in podspec. Everything 'seems' to check out. I'm still getting build errors. When I built for a device (I get same error but for i386 when I build for simulator):</p> <pre><code>Undefined symbols for architecture armv7: "_OBJC_CLASS_$_MyStaticLibrary", referenced from: objc-class-ref in MyFramework(FileInFramework.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) </code></pre> <p>I also verified again that if I just go to the app's build phases and traverse the Pods folders and manually add the MyStaticLibrary.a file to the project it builds without issue.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload