Include of non-modular header inside framework error - how do you make transitive dependencies work with cocoapods?
<p>I have created an open source library (<a href="https://github.com/linkedin/LayoutTest-iOS" rel="nofollow noreferrer">https://github.com/linkedin/LayoutTest-iOS</a>) which has two Cocoapods inside - LayoutTest and LayoutTestBase. LayoutTest depends on LayoutTestBase and one of the .h files needs to import something from LayoutTestBase. Currently, I do this using:</p>

<pre><code>@import LayoutTestBase;
</code></pre>

<p>However, this only works if the application uses <code>use_frameworks!</code> in their Podfile. Some apps do not want to use this cocoapods option. Without <code>use_frameworks!</code>, it works if I use:</p>

<pre><code>#import &lt;LayoutTestBase/LYTLayoutPropertyTester.h&gt; // OR
#import "LYTLayoutPropertyTester.h"
</code></pre>

<p>However, when using this with <code>use_frameworks!</code>, it gives the error: "Include of non-modular header inside framework module 'LayoutTest.LYTLayoutTestCase'"</p>

<p>Clearly, there should be a way of doing this import regardless of whether the user uses <code>use_frameworks!</code> or not in their Podfile. How can I get this library to compile and run correctly?</p>

<p><strong>Research</strong></p>

<p>I've looked on stackoverflow, and this seems to be the most similar question:
<a href="https://stackoverflow.com/questions/33261967/cocoapods-framework-with-dependencies-include-of-non-modular-header-inside-fra">CocoaPods framework with dependencies - include of non-modular header inside framework module</a>. It mentions that it's a problem with the Parse library, but doesn't mention how it needs to be fixed. Since I own the dependency, I can fix this.
I've also tried setting Allow non-modular frameworks to YES in all settings (projects, unit tests, all pods, etc), and this doesn't seem to do anything.</p>

<p><strong>To Reproduce</strong></p>

<p>Create a new project. Add this Podfile:</p>

<pre><code>target :'{MyAppTarget}Tests' do
pod 'LayoutTest'
end
</code></pre>

<p>Run <code>pod install</code>. Try to run unit tests on the app. It will fail. Now, try changing LYTLayoutTestCase.h to use <code>#import &lt;LayoutTestBase/LYTLayoutPropertyTester.h&gt;</code>. It now works. However, if you add <code>use_frameworks!</code> to the Podfile, it no longer works.</p>