I am working on moving my project to Swift 3.0. I started off with upgrading to the prelease version of CocoaPods (1.1.0.rc1 at time of writing).
After updating Swift Zip to the Swift 3 branch, I can no longer build the project:
No such module 'minizip'
They haven't made any changes to their podspec. In their git repository they include minizip as a git submodule. CocoaPods clones the Zip project non-recursively and so doesn't include any source files of the minizip repository.
The podspec of Zip does specify that submodules should be loaded:
s.source = { :git => "https://github.com/marmelroy/Zip.git", :tag => s.version.to_s, :submodules => true}
You can reproduce the problem by including Zip in a project with:
pod 'Zip', git: 'https://github.com/marmelroy/Zip', branch: 'swift3.0'
A recursive clone of the Zip repository:
git clone --recursive https://github.com/marmelroy/Zip ...
A non-recursive clone (in verbose mode):
/usr/local/bin/git clone https://github.com/marmelroy/Zip /var/folders/2y/hsvthlwj7_1ccflmsbdzctpw0000gn/T/d20160910-84512-1tkddau --template=
CocoaPods Environment
CocoaPods : 1.1.0.rc.1
Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
RubyGems : 2.6.4
Host : Mac OS X 10.11.6 (15G1004)
Xcode : 8.0 (8A218a)
Git : git version 2.10.0
Ruby lib dir : /usr/local/Cellar/ruby/2.3.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 9eb548f3adbad93171861d7d210cb3e572ea629d
Executable Path: /usr/local/bin/pod
cocoapods-deintegrate : 1.0.1
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.0.0
cocoapods-try : 1.1.0
platform :ios, '9.0'
use_frameworks!
pod 'AsyncSwift', git: 'https://github.com/duemunk/Async.git', branch: 'feature/Swift_3.0'
pod 'EmitterKit', git: 'https://github.com/aleclarson/emitter-kit.git', tag: '5.0.0'
pod 'SwiftyJSON', git: 'https://github.com/IBM-Swift/SwiftyJSON'
pod 'XCGLogger', git: 'https://github.com/DaveWoodCom/XCGLogger.git', branch: 'swift_3.0'
pod 'Zip', git: 'https://github.com/marmelroy/Zip', branch: 'swift3.0'
pod 'Crashlytics'
pod 'Fabric'
target 'Live'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
you need to add :submodules => true to your podfile when using a specific git repo
Thank you, that works great!
Most helpful comment
you need to add
:submodules => trueto your podfile when using a specific git repo