Search code examples
iosxcodecocoapodsxcode8ios-frameworks

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.


Solution

  • 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