pod spec lint или pod lib lint не работает при обновлении библиотеки Cocopods

Я пытаюсь обновить свою версию cocopods GLNotification.

Я перешел с Xcode 9.4 -> Xcode 10. Я преобразовал свой код в последнюю версию 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' => '[email protected]' }
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'

Исправить, как я пытался

  • Добавил s.swift_version = '4.1' в свой GLNotificationBar.podspec
  • Изменено Swift Language Version на 4.2 в настройках сборки
  • Цель развертывания iOS обновлена ​​с iOS 8 до iOS 10.

Команда терминала, которую я пробовал

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

person Gokul G    schedule 25.10.2018    source источник
comment
К вашему сведению, последний тег не работает в их собственном репо. travis-ci.org/gokulgovind/GLNotificationBar. NVM только что понял, что это ваш собственный репозиторий.   -  person Dare    schedule 25.10.2018


Ответы (2)


Вы пытались обновить языковую версию Swift в спецификации модуля? Это может быть проблема компиляции для несоответствующих языковых версий. Я вижу это в вашем файле спецификации модуля.

Это ваш последний коммит, и он по-прежнему настроен на более раннюю версию Swift, чем проект настройки.

person Dare    schedule 25.10.2018
comment
Я добавил s.swift_version, пытаясь решить эту проблему. Даже после удаления этого я получаю ту же ошибку. - person Gokul G; 26.10.2018
comment
Вы когда-нибудь находили решение? - person Scaraux; 20.01.2019

Поскольку вы перешли на X-Code 10, на данный момент он поддерживает swift 4 и 4.2, поэтому вам необходимо иметь такие же параметры в настройках сборки, как и в спецификации Pods.

Если вы не используете swift 3,4 и 4.2, вам нужно перейти в File->Workspace Setting.

и выберите систему сборки Legacy Build System.

Вам нужно зафиксировать все и нажать на git.

Обновите тег до новой версии и нажмите на тег.

Затем попробуйте нажать на ствол Cocoapods push --allow-warnings.

Дайте мне знать, если у вас возникнут какие-либо проблемы после того, как вы попробуете это.

Спасибо.

введите здесь описание изображения

введите здесь описание изображения

person Vivek Kumar    schedule 25.10.2018
comment
Спасибо за ваш ответ, я попробовал ваше предложение. но все же я получаю ту же ошибку - person Gokul G; 26.10.2018