Cocoapods can't find header xcode 6

元气小坏坏 提交于 2019-11-29 22:17:30

I found solution. In your project properties replace this:

jwswart

You might also want to link your pods with both your targets like so:

platform :osx, '10.7'

link_with 'MyApp', 'MyApp Tests'
pod 'AFNetworking', '~> 1.0'
pod 'Objection', '0.9'

From Cocoapods docs and this answer


Update: This no longer works for Cocoapods 1.0+, the correct way to implement the Podfile is:

platform :ios, '9.0'
inhibit_all_warnings!

target 'MyApp' do
  pod 'ObjectiveSugar', '~> 0.5'

  target "MyAppTests" do
    inherit! :search_paths
    pod 'OCMock', '~> 2.0.1'
  end
end

Source: https://guides.cocoapods.org/syntax/podfile.html#podfile

I was able to fix this in my project. I had a second target for tests. I never used this target and the error disappeared after I deleted it from the project. So maybe not your main target is the source of the problem, but another one.

I agree with jwswart's answer because quite many times I have realized that the issue with just defining dependencies for the 'MyApp' and leaving out 'MyAppTests' as in:

target :'MyApp' do

..

end

breaks the build process because the classes defined in 'MyApp' make use of the dependencies which are not visible in the 'MyAppTests'. Thus as jwswart suggested:

link_with 'MyApp', 'MyApp Tests'

Just have a try to comment this line for your target

#  use_frameworks!

~~

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