问题
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