4

Anyone had any luck creating a pod with a SSZipArchive dependency? My classes are all in Swift but I'm including my bridging file as well (#import "SSZipArchive"). When I try to lint I get 9 errors all related to SSZipArchive. Please let know your thoughts. Thanks so lot!

  • ERROR | SSZipArchive/SSZipArchive/minizip/ioapi.h:45:10: error: include of non-modular header inside framework module 'SSZipArchive.ioapi'
  • NOTE | Target Support Files/Pods-SSZipArchive/Pods-SSZipArchive-umbrella.h:5:9: note: in file included from Target Support Files/Pods-SSZipArchive/Pods-SSZipArchive-umbrella.h:5:
  • ERROR | SSZipArchive/SSZipArchive/minizip/mztools.h:15:10: error: include of non-modular header inside framework module 'SSZipArchive.mztools'
  • NOTE | SSZipArchive/SSZipArchive/minizip/mztools.h:18:10: note: in file included from SSZipArchive/SSZipArchive/minizip/mztools.h:18:
  • ERROR | SSZipArchive/SSZipArchive/minizip/unzip.h:51:10: error: include of non-modular header inside framework module 'SSZipArchive.unzip'
  • NOTE | Target Support Files/Pods-SSZipArchive/Pods-SSZipArchive-umbrella.h:7:9: note: in file included from Target Support Files/Pods-SSZipArchive/Pods-SSZipArchive-umbrella.h:7:
  • ERROR | SSZipArchive/SSZipArchive/minizip/zip.h:50:10: error: include of non-modular header inside framework module 'SSZipArchive.zip'
  • NOTE | Target Support Files/Pods-VideoPlayerLibrary/Pods-VideoPlayerLibrary-umbrella.h:3:9: note: in file included from Target Support Files/Pods-VideoPlayerLibrary/Pods-VideoPlayerLibrary-umbrella.h:3:
  • ERROR | VideoPlayerLibrary/Pod/Classes/VideoPlayerLibrary-Bridging-Header.h:12:9: error: could not build module 'SSZipArchive'
  • NOTE | :0: error: could not build Objective-C module 'VideoPlayerLibrary'

Here is my pod spec file:

Pod::Spec.new do |s|
  s.name                  = "VideoPlayerLibrary"
  s.version               = "1.0.27"
  s.platform              = :ios, "4.0"
  s.ios.deployment_target = "8.3"
  s.requires_arc          = true
  s.source_files          = 'Pod/Classes/*'
  s.resource_bundles      = {
    'VideoPlayerLibrary' => ['Pod/Assets/*']
  }
  s.library = 'zlib', 'z'
  s.frameworks = 'Foundation', 'UIKit'
  s.dependency 'Alamofire'
  s.dependency 'SSZipArchive'
end
Cœur
  • 37,241
  • 25
  • 195
  • 267
Marc Nunes
  • 238
  • 3
  • 13

2 Answers2

0

I couldn't wait for a better solution, my temporary solution was to create a zipArchive class which talks to the SSZipArchive pod in objc. Not pretty and not ideal but works for now. I hope they update it soon.

Note: you would import zipArchive.h in your bridging-header file and not SSZipArchive.h

#import "zipArchive.h"
#import <SSZipArchive/SSZipArchive.h>

@implementation zipArchive

+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination{
    return [SSZipArchive unzipFileAtPath:path toDestination:destination];
}

@end

You also need to set "Allow Non-modular includes" in your project settings

enter image description here

Marc Nunes
  • 238
  • 3
  • 13
  • I just ran into this -- is this still the best solution you have found? Do you have a sense of what is even causing the problem? – Hélène Martin Jun 19 '15 at 18:55
  • not yet since I'm no longer working on that project. I will try this week and let you know. – Marc Nunes Jun 23 '15 at 16:18
  • @HélèneMartin - I got it to work. I had to install the pre release version of cocoapods (uninstall cocoapods then run sudo gem install cocoapods --pre), then in your swift file import SSZipArchive. Hope it works for you it looks like they already have a fix for this :) – Marc Nunes Jul 06 '15 at 16:09
  • That's wonderful to know -- thanks @marcio-arantes! I'll give it a shot soon. – Hélène Martin Jul 07 '15 at 14:02
0

I was able to get SSZipArchive to compile but it was not after looking at their swift example https://github.com/ZipArchive/ZipArchive and copying their implementation exactly which compiled and ran for me.

this was after no success doing the various existing suggestions I have searched for in swift

I ended up having to adjust framework source , copy linker files, flags, to get things to match and eventually compile. It was pretty tedious because there were quite a number of changes in my current pod and even in my project .

yeahdixon
  • 6,647
  • 1
  • 41
  • 43