0

I am getting compile error when I added a framework into my app. Framework Feature1 is built successfully but from module App import is not working.

enter image description here

How to solve this issue?

Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256
  • 1
    This might be helpfull - https://stackoverflow.com/questions/29500227/getting-error-no-such-module-using-xcode-but-the-framework-is-there – shbedev Nov 18 '19 at 12:35
  • Can you describe how you add Feature1 framework to App? – Serhii Londar Nov 18 '19 at 14:44
  • @SerhiiLondar i just imported as they are in the same workspace. Should i do any extra step? Feature1 and Feature2 (frameworks) worked fine when called from one another without any extra step. But when i import to App (single page project) did not work though. – Sazzad Hissain Khan Nov 18 '19 at 14:59
  • Please check "Frameworks, Libraries And Embedded Content" section in General tab in your application target settings. Maybe you forgot to add your framework there. – Serhii Londar Nov 18 '19 at 15:14
  • @SerhiiLondar I should embed only for application target? from framework to framework call this it not required? – Sazzad Hissain Khan Nov 18 '19 at 16:26
  • Yes. You should embed your framework for your application. – Serhii Londar Nov 18 '19 at 16:27

1 Answers1

0

There are several potential misconfigurations the issue can arise for,

  1. Please confirm that you have opened the .xcworkspace but not .xcodeproj file. Also make sure you have build Feature1 first before you build App.
  2. Make sure that iOS Deployment Target is set same for all modules with App. For example is Apps deployment target is set to 9.0, Feature1s deployment target also need to be set to 9.0.
  3. Make sure your main module (App) and your used framework (Feature1) have same set of configurations. i.e. If your Project has three configurations, Debug, Release, ReleasePremium than your Framework also need to have three configurations Debug, Release, ReleasePremium. Also make sure that the archive configuration is set same for both App and Feature1. i.e. if your Apps archive scheme is set to ReleasePremium, your Fearure1s archive scheme also need to be set into ReleasePremium.
  4. Please assure that you do not need to import Feature1 in each .swift files when its already added in the Bridging-Header.h.
  5. In case of issue came from Pod files, make sure you have uncommented #use_frameworks! into use_frameworks! from you Podfile. Sometime re installing pod works if Feature1 has any dependency on pods.
  6. If none of the above steps works, delete your derived data folder and try re building.
Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256