繁体   English   中英

更新cocoapods库时,pod spec皮棉或pod lib皮棉失败

[英]pod spec lint or pod lib lint fails while updating cocoapods library

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

我已经从Xcode 9.4-> Xcode 10切换了。 在此之后,我无法更新自己的Pod,因此我已将代码转换为最新的Swift版本。

但是我的代码中没有警告或错误。 工作正常。 在此处下载我的代码。

我的豆荚规格

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

您是否尝试过在Pod规范中更新Swift语言版本? 语言版本不匹配可能是编译问题。 我在您的pod规格文件中看到了这一点。

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

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

如果您不使用swift 3,4和4.2,则需要转到File-> Workspace Setting

并选择“ Legacy Build System”(旧版构建系统)。

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

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

然后尝试推到Cocoapods荚树干推--allow-warnings。

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

谢谢。

在此处输入图片说明

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM