swift - Lint 具有 SSZipArchive 依赖项的 Swift cocoa pod

标签 swift cocoapods lint podspec ssziparchive

有人有幸创建了一个依赖 SSZipArchive 的 pod 吗?我的类(class)都在 Swift 中,但我也包括我的桥接文件(#import "SSZipArchive")。当我尝试 lint 时,我收到 9 个错误,所有错误都与 SSZipArchive 相关。请让我们知道您的想法。非常感谢!

  • 错误 | SSZipArchive/SSZipArchive/minizip/ioapi.h:45:10: 错误:在框架模块“SSZipArchive.ioapi”中包含非模块化 header
  • 注意 | Target Support Files/Pods-SSZipArchive/Pods-SSZipArchive-umbrella.h:5:9:注意:包含在 Target Support Files/Pods-SSZipArchive/Pods-SSZipArchive-umbrella.h:5 中的文件中:
  • 错误 | SSZipArchive/SSZipArchive/minizip/mztools.h:15:10: 错误:包含框架模块“SSZipArchive.mztools”内的非模块化 header
  • 注意 | SSZipArchive/SSZipArchive/minizip/mztools.h:18:10: 注意:在 SSZipArchive/SSZipArchive/minizip/mztools.h:18 包含的文件中:
  • 错误 | SSZipArchive/SSZipArchive/minizip/unzip.h:51:10: 错误:在框架模块“SSZipArchive.unzip”中包含非模块化 header
  • 注意 | Target Support Files/Pods-SSZipArchive/Pods-SSZipArchive-umbrella.h:7:9:注意:包含在 Target Support Files/Pods-SSZipArchive/Pods-SSZipArchive-umbrella.h:7 中的文件中:
  • 错误 | SSZipArchive/SSZipArchive/minizip/zip.h:50:10: 错误:在框架模块“SSZipArchive.zip”中包含非模块化 header
  • 注意 | Target Support Files/Pods-VideoPlayerLibrary/Pods-VideoPlayerLibrary-umbrella.h:3:9:注意:包含在 Target Support Files/Pods-VideoPlayerLibrary/Pods-VideoPlayerLibrary-umbrella.h:3 中的文件中:
  • 错误 | VideoPlayerLibrary/Pod/Classes/VideoPlayerLibrary-Bridging-Header.h:12:9: 错误:无法构建模块“SSZipArchive”
  • 注意 | :0: 错误:无法构建 Objective-C 模块“VideoPlayerLibrary”

这是我的 pod 规范文件:

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

最佳答案

我等不及更好的解决方案了,我的临时解决方案是创建一个 zipArchive 类,它与 objc 中的 SSZipArchive pod 对话。不漂亮也不理想,但现在可以使用。我希望他们尽快更新。

注意:您将在桥接头文件中导入 zipArchive.h 而不是 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

您还需要在项目设置中设置“允许非模块化包含”

enter image description here

关于swift - Lint 具有 SSZipArchive 依赖项的 Swift cocoa pod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30113240/

相关文章:

arrays - 将 Array<String> 转换为 String 然后返回 Array<String>

ios - cocoa pod xcode 5 产品 -> 配置文件显示警告和错误

swift - 没有这样的模块 JSQMessagesViewController

c - lint 中强类型检查的问题(警告 632)

iOS 图表降低了我的应用程序速度

objective-c - 在 Swift 中命名 Obj-C 属性 getter 和 setter

ios - `xcconfig` 文件中的条件用户定义变量

ios - `pod install` 之后的空 Pod header 文件夹

android - 如何忽略在 android lint 中分析整个模块

c - PC-Lint Misra 10.1 bool 表达式错误