Cocoapods podspec dependency import file not found

天大地大妈咪最大 提交于 2019-12-10 13:06:21

问题


I'm trying to make a Cocoapod that depends on another but I'm having issues at compile time. Say in this case MyApp is using CocoapodA and CocoapodB, B relies on A.

MyApp Podfile:

platform :ios, '5.0'
pod 'CocoapodA'
pod 'CocoapodB', :path => '../../CocoapodB'

CocoapodB Podspec:

s.dependency 'CocoapodA'

but when I try to compile I get 'CocoapodA/CocoapodA.h' file not found where the import in CocoapodB is trying to include it.

I've tried reading the Podspec documentation but I didn't really get what I'm missing. I also tried s.library = 'CocoapodA'.


回答1:


Make sure that you correctly specify header files for CocoapodA, for example:

s.public_header_files = 'CocoapodA/**/*.h'




回答2:


My problem ended up being that the OTHER_LDFLAGS were being overridden. After selecting the Other Linker Flags key (build settings) and pressing backspace it now builds.

Weirdly I can only build on actual device; both simulator and archive are failing. They're probably caused by something else.



来源:https://stackoverflow.com/questions/19548890/cocoapods-podspec-dependency-import-file-not-found

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