0

it is a simple spec that is

#
# Be sure to run `pod lib lint test.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'test'
  s.version          = '0.1.0'
  s.summary          = 'A short description of test.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
TODO: Add long description of the pod here.
                   DESC

  s.homepage         = 'https://github.com/vincentgemini/test'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'vincentgemini' => 'vincent_gemini@163.com' }
  s.source           = { :git => 'https://github.com/vincentgemini/test.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '8.0'

  s.source_files = 'test/Classes/**/*'
  s.vendored_libraries = 'test/Module/**/*.a' 

  # s.resource_bundles = {
  #   'test' => ['test/Assets/*.png']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
  # s.frameworks = 'UIKit', 'MapKit'
  # s.dependency 'AFNetworking', '~> 2.3'
end

the folder tree is

test
├── Assets
├── Classes
│   ├── ViewController.h
│   └── ViewController.m
└── Module
    ├── include
    │   └── MMM
    │       └── MMM.h
    └── libMMM.a

but when pod lib lint, there is a error that /Users/gemini_mxz/Desktop/test/test/Classes/ViewController.m:11:9: fatal error: 'MMM/MMM.h' file not found.

the ViewController.m is

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    MMM *m = [[MMM alloc] init];
    NSLog(@"%@", a);
}

i have try that used preserve_paths or xcconfig, but the error still exist。

  • In your Podfile, you might want to add also `s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/test/Module/include" }` (maybe witouth "test", it depends on where is your podspec according to that folder tree). Also, I don't know if it's a typo, but in the path for vendored_library, you wrote "Modues" instead of "Module". – Larme Feb 21 '18 at 10:18
  • @Larme you are careful, it is careless that i mistake "Modues", but i have trid that both s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/test/Module/include" and s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/Module/include" the error still exist。 –  Feb 21 '18 at 10:34
  • `s.vendored_libraries = 'test/Module/**/*.a'` => s.vendored_libraries = 'test/Module/*.a' because there is no subfolder? Also, what's the import you do for the MMM? – Larme Feb 21 '18 at 20:20
  • @Larme The ViewController import "MMM/MMM.h" –  Feb 22 '18 at 02:48
  • try import "MMM.h" – Paul Beusterien Feb 24 '18 at 22:31

0 Answers0