Swift Project: "Missing Required Modules" when importing a modular structure

Customization

  • I am creating a quick structure that includes a C library (CommonCrypto) and an Objective C file.

  • There is no bridge header in a fast project. Therefore, I am creating module.modulemap to import CommonCrypto and Objective-C files into my fast infrastructure.

    module.modulemap: enter image description here

Here is an example module.modulemap link: Importing CommonCrypto in a quick context

  1. Modulus.modulusmap module has been added to project settings for quick compilation enter image description here

    So, in my fast structure everything is working fine. I can use a module like this

    enter image description here

Problem shows

  • Archive modular structure and export as embedded products.

  • In my quick select project add modular structure for embedded binaries enter image description here

  • An error occurs on this line when I use something inside the frame enter image description here

I tried so many solutions, but still not working.

Similar issues:

Does anyone have a good solution? thanks!!

+5
source share
1 answer

Decision

the iOS infrastructure exists as a folder, create module.modulemap to search for a library or header file.

  • Setting module.modulemap path

    In the project / goals / Build options / Swift Compile - Search path / import path = "$ {SRCROOT}"

  • Add below module.modulemap

enter image description here

Notes

You do not need to add module.modulemap to the sample project if the infrastructure is archived in the same development environment.

+3
source

Source: https://habr.com/ru/post/1263907/


All Articles