在制作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,会代码报错。
注释以后可以正常编辑通过。

你可能感兴趣的:(在制作pod 依赖库时报错解决)