Zip: Missing required module 'minizip'
We wanted to incorporate Zip framework within our open-source QuantiLogger framework and struggled with Missing required module ‘minizip’ problem. We have spent couple days trying to solve the problem without any success. We have also observed existing issues related to this problem and tried all proposed solutions. Finally we ended up using ZipFoundation instead.
In order to demonstrate the problem, we created a simple example app. It is just an empty Simple View App that does not actually do anything apart from including the Zip framework. We used Carthage to import the framework. After I prepared the demonstrating app, it all built successfully even with included Zip framework. I also tried to create a new folder where I cloned the demonstrating app directly from Github and again, built successfully. The problem occured when another team member cloned the repository. After he did so, he build with Missing required module ‘minizip’ failure. Then he performed carthage update and suddenly all built successfully.
You can hopefully recreate the problem as well by cloning the demonstrating app and trying to build it.
As mentioned before, we solved the problem by using another framework (unfortunately). However we are very curious why the problem occurs since we spent much time trying to solve it ourselves.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 9
- Comments: 25 (1 by maintainers)
I’m also looking for solution for this issue. Unfortunately, it is related not only to this repository, but all frameworks which uses
modulemapinside. Easiest way to reproduce it - to build a framework(manually or via carthage) and then remove/move sources to another folder. Example:Why does it happen? Seems like when a framework project contains a module with C code and as result a module map to this code, then result framework will contain links to the same C code with absolute paths. You can see that inside
Zip.framework/Modules/Zip.swiftmodule/. Just open any swiftmodule file with any text editor and look for old modulemap path. I mean, this C code/headers(maybe just headers, not sure about that) should be placed at the same place for using the framework, otherwise framework won’t find this C-module (in this case - minizip)Workaround Only workaround what I’ve found is to copy minizip folder(folder with C code) inside your project (where you have to use Zip.framework) and configure
Import Pathsto this directory. Then, when Zip.framework have to find mini zip module, it will use the project settings (module is configured and load to the project already). So, either do not removeCheckoutdirectory for carthage (because framework will look for minizip module there) and as result do not use any caches for carthage (like rome), or add minizip directory to your project and configureImport Paths.If someone knows how it could be avoided, I would gladly to use it, because I don’t like either solutions. Much better when a framework contains all code/information and we do not need to do anything for working with it
Bridging-Header solution If we remove using modulemap and add Bridging-Header to the project, then this case will work only when we don’t have
Checkoutsfolder. But at the same time, it won’t work if sources are there (if you build it through carthage and do not removeCheckoutsdirectory). In that case you will haveFailed to import bridging headererror when trying to build your project.Bump. Still seeing this. Xcode 12.4, targeting iOS 14.4.
Has anyone solved this for Swift Package Manager?
@marmelroy It has not been fixed. Tried on XCode 12.0.1 using SPM to install Zip v. 2.1.1. The error persists:
The problem lays in
SWIFT_INCLUDE_PATHS = "${SRCROOT}/Zip/minizip/**". It’s not a reliable way to depend on${SRCROOT}as the binary could be built on a different machine or sources could be deleted.Steps to reproduce:
github "marmelroy/Zip" ~> 2.1carthage update|bootstrapCarthage/CheckoutsdirectoryMissing required module 'Minizip'I got the same problem trying to import the IOS-Pods-DFU-Library library via
CarthageJust found a way to reproduce this issue (got it on our Jenkins, then replaced my local Carthage/Build folder to the one built on jenkins side, and got the same issue), then I make it simple (and local):
Moving back
othertoprojectmakexcodebuildbuilds fine (after removing DerivedData)I think it is related to bcsymbolmap file containing absolute paths…