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
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
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 .
来源:https://stackoverflow.com/questions/30113240/lint-a-swift-cocoa-pod-with-ssziparchive-dependency