【问题标题】:pod spec lint or pod lib lint fails while updating cocoapods library更新 cocoapods 库时 pod spec lint 或 pod lib lint 失败
【发布时间】:2018-10-25 15:10:06
【问题描述】:

我正在尝试更新我的GLNotification cocopods 版本。

我已从 Xcode 9.4 -> Xcode 10 切换。我已将我的代码转换为最新的 swift 版本,之后我无法更新我的 pod。

但我的代码中没有警告或错误。它工作正常。下载我的代码here

我的 Pod 规格

Pod::Spec.new do |s|
s.name             = 'GLNotificationBar'
s.version          = '2.3.6'
s.summary          = 'GLNotificationBar lets user to handle push  notification when app is active.'

s.description      = <<-DESC
GLNotificationBar is a open source library that lets developers to display push notification or any alert message to end user as banner. iOS below 10 does't displays notification when app is active. This library is inspired by Apple's ios10 notification bar.
DESC

s.homepage         = 'https://github.com/gokulgovind/GLNotificationBar'
s.license          = { :type => 'MIT', :file => 'LICENSE' }
s.author           = { 'gokul' => 'gokulece26@gmail.com' }
s.source           = { :git => 'https://github.com/gokulgovind/GLNotificationBar.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.source_files = 'GLNotificationBar/Classes/**/*'
s.resource_bundles = {
'GLNotificationBar' => ['GLNotificationBar/Classes/*.xib','GLNotificationBar/Assets/*.png']
}
s.frameworks = 'UIKit'

end

错误

-> GLNotificationBar (2.3.6)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:247:59: error: type 'UIWindow' has no member 'Level'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:278:44: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:323:69: error: type 'UIWindow' has no member 'Level'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:419:115: error: type 'UIResponder' has no member 'keyboardWillShowNotification'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:420:114: error: type 'UIResponder' has no member 'keyboardWillHideNotification'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:486:44: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:487:44: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:489:44: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:527:64: error: type 'UIControl' has no member 'State'
- NOTE  | xcodebuild:  UIKit.UIControl:16:14: note: did you mean 'state'?
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:528:90: error: type 'UIControl' has no member 'Event'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:744:55: error: type 'UIWindow' has no member 'Level'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:813:80: error: type 'UIView' has no member 'AnimationOptions'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:916:33: error: type 'UITextField' has no member 'BorderStyle'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:920:38: error: type 'UIControl' has no member 'State'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:922:67: error: type 'UIControl' has no member 'State'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:990:47: error: type 'UIWindow' has no member 'Level'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:1005:43: error: type 'UIResponder' has no member 'keyboardFrameEndUserInfoKey'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:1018:43: error: type 'UIResponder' has no member 'keyboardFrameEndUserInfoKey'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:1123:27: error: type 'NSAttributedString' has no member 'Key'
- ERROR | xcodebuild:  GLNotificationBar/GLNotificationBar/Classes/GLNotificationBar.swift:1132:27: error: type 'NSAttributedString' has no member 'Key'

我试过了

  • 在我的GLNotificationBar.podspec 中添加了s.swift_version = '4.1'
  • 在构建设置中将 Swift Language Version 更改为 4.2
  • 将 iOS 部署目标从 iOS 8 更新到 iOS 10

我尝试过的终端命令

 pod spec lint GLNotificationBar.podspec
 pod spec lint
 pod spec lint --allow-warnings

【问题讨论】:

标签: ios swift xcode cocoapods swift4.2


【解决方案1】:

您是否尝试过在您的 pod 规范中更新 Swift 语言版本? 这可能是不匹配的语言版本的编译问题。

This 是您的最新提交,它仍然设置为比项目设置更早的 Swift 版本。

【讨论】:

  • 我在尝试解决此问题时添加了 s.swift_version。即使在删除之后,我也会遇到同样的错误。
  • 您找到解决方案了吗?
【解决方案2】:

当您迁移到 X-Code 10 时,它目前支持 swift 4 和 4.2,因此您需要在构建设置和 Pods Spec 中具有相同的设置。

如果你没有使用 swift 3,4 和 4.2 则需要进入 File->Workspace Setting

然后选择构建系统到 Legacy Build System。

您需要提交所有内容并推送到 git。

将标签更新到新版本并推送到标签。

然后尝试推送到 Cocoapods pod trunk push --allow-warnings。

如果您在尝试后遇到任何问题,请告诉我。

谢谢。

【讨论】:

  • 感谢您的回复,我尝试了您的建议。但我仍然遇到同样的错误
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-10-02
  • 1970-01-01
  • 2019-03-18
  • 1970-01-01
  • 2015-11-21
  • 2018-03-05
  • 1970-01-01
相关资源
最近更新 更多