Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including a pod inside a framework target: file not found

I'm using framework targets (for better code reuse and IB_Designables), and I've already had a framework target working perfectly. I've decided to move some other classes to a framework target too.

I've set up the pods (just a single one in this case), but whenever I try to include the pod I'm getting not found error.

enter image description here

No change if I try to use the modules approach too:

enter image description here

The problem is that I've already got another framework too, with the same settings (cross checked all the compiler settings/linker flags/build phases etc) and that framework has no issue importing its pods.

Here is my podfile (TUComponents is the working on, TUModels is the failing one):

[...]
target 'TUComponents' do


    pod 'AHKNavigationController'
    pod 'TTTAttributedLabel'

    use_frameworks!


end

target 'TUModels' do


    pod 'JSONModel'

    use_frameworks!


end

Even weirder; Xcode has no problem code-completing importing the JSONModel/JSONModel.h header (or JSONModel in case of module @import). But when I try to compile, it fails.

What might be wrong with my configuration?

UPDATE: If I give up using frameworks in pods and use regular old static library, and set allow non-modular includes in frameworks to YES, I can build. But I have no idea why I can't build when using Pod frameworks.

like image 683
Can Poyrazoğlu Avatar asked Jun 12 '17 17:06

Can Poyrazoğlu


2 Answers

Maybe try solution from: https://www.natashatherobot.com/cocoapods-installing-same-pod-multiple-targets/

platform :ios, '9.0'

use_frameworks!

# My other pods

def testing_pods
    pod 'JSONModel'
end

target 'TUComponents' do
    pod 'AHKNavigationController'
    pod 'TTTAttributedLabel'
    testing_pods
end

target 'TUModels' do
    testing_pods
end
like image 156
S. Matsepura Avatar answered Nov 15 '22 03:11

S. Matsepura


From iOS - Build fails with CocoaPods cannot find header files :

Make sure your Podfile includes link_with on targets missing a config file. Cocoapods only sets the first target by default otherwise. e.g.

platform :osx, '10.7'
pod 'JSONKit',       '~> 1.4'

link_with 'Pomo', 'Pomo Dev', 'Pomo Tests'
like image 22
mikep Avatar answered Nov 15 '22 05:11

mikep