在制作pod 依赖库时报错解决

在制作pod 依赖库时,出现以下错误:

   - ERROR | [iOS] [YZLControlHelper/SliderView] xcodebuild:  /Users/balopy/Balopy_Git/幸知在线/YZLUsuallyControlHelper/YZLControlHelper/Classes/SliderView/BLSliderCollectionCell.swift:38:32: error: use of unresolved identifier 'BLImageNamed'
   - ERROR | [iOS] [YZLControlHelper/SliderView] xcodebuild:  /Users/balopy/Balopy_Git/幸知在线/YZLUsuallyControlHelper/YZLControlHelper/Classes/SliderView/BLSliderCollectionCell.swift:53:22: error: value of type 'UILabel?' has no member 'snp_makeConstraints'
   - ERROR | [iOS] [YZLControlHelper/SliderView] xcodebuild:  /Users/balopy/Balopy_Git/幸知在线/YZLUsuallyControlHelper/YZLControlHelper/Classes/SliderView/BLSliderCollectionCell.swift:61:22: error: value of type 'UIButton?' has no member 'snp_makeConstraints'
   - ERROR | [iOS] [YZLControlHelper/SliderView] xcodebuild:  /Users/balopy/Balopy_Git/幸知在线/YZLUsuallyControlHelper/YZLControlHelper/Classes/SliderView/BLSliderCollectionCell.swift:71:22: error: value of type 'UIButton?' has no member 'snp_makeConstraints'

应该是.podspec文件中源文件s.source_files格式有误,修改一下就可以通过了。按照谷歌帖子写成下面的格式就可以

    s.source_files = 'YZLControlHelper/Classes/DropListView/*', 'YZLControlHelper/Classes/Extensions/*', 'YZLControlHelper/Classes/ScreenView/*', 'YZLControlHelper/Classes/SliderView/*', 'YZLControlHelper/Classes/Usually/*'

如果报以下错误:

    - WARN  | url: The URL (https://gitee.com/BeiJingYiZhiLuKeJiYouXianGongSi/YZLUsuallyControlHelper) is not reachable.
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    - ERROR | xcodebuild:  /Users/balopy/Balopy_Git/幸知在线/YZLUsuallyControlHelper/YZLControlHelper/Classes/Usually/BLScrollLabel.swift:43:58: error: 'commonModes' has been renamed to 'RunLoop.Mode.common'
    - NOTE  | xcodebuild:  Foundation.RunLoop.Mode:9:23: note: 'commonModes' was obsoleted in Swift 4.2

[!] YZLControlHelper did not pass validation, due to 2 errors.
You can use the `--no-clean` option to inspect any issue.

s.swift_version 注释掉,因为4.2以后,commonModes 改为 RunLoop.Mode.common,这个好像有坑,因为我使用RunLoop.Mode.common,会代码报错。
注释以后可以正常编辑通过。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 本文将介绍的是如何使用hexo与GitHub搭建一个免费的个人博客,作为学生党和爱好写作人士这篇博文一定会让你有所...
    洋芋吃马铃薯阅读 266评论 0 1
  • CashMoneyAP Aye, aye, aye Nowadays I'm too cool for a gir...
    苏康阅读 453评论 0 0
  • 10个excel小技巧 01快速输入 方法一:单元格设置法 方法二:设置单元格格式→自定义→[=1]"华凌组织";...
    美华小姐姐阅读 616评论 0 1
  • 痕 若人生是一场修行, 你, 便是我跨不过去的, 劫。 你的离去渐渐成为, 我, 心中的一道深深的, 梗。 . 若...
    七七行记阅读 297评论 0 0
  • 婚姻里两个人,互不过问不干涉 友谊里两个人,背后亮出锋刃 这些都是一个状态 如夏天遇到暴雪,冻死春天的花蕊 ...
    川北书生_0827阅读 271评论 2 8