I have created a simple swift framework from scratch and was able to use it by adding the framework to a newly created app project. Just to test, I've also created just another app project and was able to use the same framework there as well. But when I add the framework to an existing project/workspace, I'm no longer able to build the app with the following error:
No such module 'TestFramework1'
I'm using Xcode 14.3
on Apple Silicon
to create the test app and framework and validated many other possible solutions discussed here and here with the existing project to no avail:
use_frameworks!
in my pod file, as instead I use use_modular_headers!
Framework setup:
App project setup:
Here it works fine for a newly created project:
Here is the error with an existing project:
What else should I check apart from the options defined above to make it work with the existing project?
Found the issue, if someone else hits the same. The existing app has configuration different from the one defined by the framework. That is why a new app worked well while an existing app was trying to use a custom configuration and wasn't able to build/find the framework. I created the same configuration for the framework to match my host app here and it started to work as expected: