Getting error “No such module” using Xcode, but the framework is there

前端 未结 30 1874
小蘑菇
小蘑菇 2020-11-22 05:02

I\'m currently coding in Swift, and I\'ve got an error:

No such module Social

But I don\'t understand, because the module is in

相关标签:
30条回答
  • 2020-11-22 05:25

    I am not quite sure why Martin R's answer in the comments for the question is so disregarded:

    Make sure that you tried simply skipping import of the framework as it is already added with the bridging header.

    Hope this helps

    0 讨论(0)
  • 2020-11-22 05:25

    Assuming the Framework really is there and in the path, etc... delete the ~/Library/Developer/Xcode/DerivedData/ModuleCache directory (and clean the project and delete the project-specific derived data for good measure).

    When you do the standard cleanup, the ModuleCache directory doesn't get rebuilt.

    0 讨论(0)
  • 2020-11-22 05:25

    If you are using Carthage, the frameworks in building setting usually stay in

    $(PROJECT_DIR)/Carthage/Build/iOS

    If you run carthage update --platform ios --no-build (to save time) the files inside Build folder will not be reacreated, then the modules will no available to XCode.

    In my case, I have run carthage update --platform ios, then my problem was solved.

    0 讨论(0)
  • 2020-11-22 05:26

    Make sure that the naming of you configurations in the sub projects matches that of the "parent" project. If the configuration naming don't match exactly (case-sensitive), Xcode will abort the archive process and show the error "No such module ..."

    That is, if you have a "parent" project with a configuration named "AppStore" you must make sure that all subprojects also have this configuration name.

    See my attached screenshots.

    0 讨论(0)
  • 2020-11-22 05:27

    My issue was with multiple targets. I solved it with below links: configure pod file right way and fix build settings

    Hope some one will find it helpful.

    0 讨论(0)
  • 2020-11-22 05:30

    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 Social first before you build TriviaApp.
    2. Make sure that iOS Deployment Target is set same for all modules with main app. For example is TriviaApps deployment target is set to 9.0, Socials deployment target also need to be set to 9.0.
    3. Make sure your main module (TriviaApp) and your used framework (Social) have same set of configurations. i.e. If your Project has three configurations, Debug, Release, ReleasePremium than your Social framework also need to have three configurations Debug, Release, ReleasePremium. Also make sure that the archive configuration is set same for both TriviaApp and Social. i.e. if your TriviaApps archive scheme is set to ReleasePremium, your Socials archive scheme also need to be set into ReleasePremium.
    4. Please assure that you do not need to import Social 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 Social has any dependency on pods.
    6. If none of the above steps works, delete your derived data folder and try re building.
    0 讨论(0)
提交回复
热议问题