Cocoapods:pod lint可以工作,但pod repo推送无法验证,因为缺少版本框架



我有一个iOS&tvOS框架,我正试图将其作为一个私有的、仅二进制的CocoaPod发布。Podspeclint没有错误,但将其推送到repo失败验证。推送和打绒时的验证步骤是否不同?

Foo.podspec

仅相关部分:

spec.name                = 'Foo'
spec.version             = '0.0.4'
spec.source              = { :git => 'git@github.com:private-repo/Foo.git', :tag => spec.version.to_s }
spec.static_framework    = true
spec.swift_version       = '5.0'
spec.cocoapods_version   = '>= 1.7.0'
# Deployment Targets
spec.platforms = { :ios => "11.0", :tvos => "11.0" }
spec.ios.deployment_target = 11.0
spec.tvos.deployment_target = 11.0
spec.source                  = { :http => "<repo-url>/Foo-#{spec.version}.zip" }
spec.vendored_frameworks     = 'Build/Products/Debug-iphonesimulator/FooiOS.framework', 'Build/Products/Debug-appletvsimulator/FootvOS.framework'
# Third-Party Dependencies
spec.ios.dependency 'GoogleAds-IMA-iOS-SDK', '~> 3.11'
spec.tvos.dependency 'GoogleAds-IMA-tvOS-SDK', '~> 4.2'

注意,我将工作区的构建输出目录更改为项目根的本地目录,而不是默认的~/Library/Developer/Xcode/Derived Data文件夹

pod lib lint

$ bundle exec pod lib lint Foo.podspec --private --allow-warnings --sources=private-repo,master
-> Foo (0.0.4)
- WARN  | url: The URL (https://github.com/private-repo/Foo) is not reachable.
- NOTE  | xcodebuild:  note: Using new build system
- NOTE  | xcodebuild:  note: Planning build
- NOTE  | xcodebuild:  note: Constructing build description
- NOTE  | xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
- NOTE  | [iOS] xcodebuild:  ld: warning: building for iOS Simulator, but linking in dylib file (/Users/tibbettsj/Developer/arc-video-sdk-ios/Build/Products/Debug-appletvsimulator/ArcMediaPlayertvOS.framework/ArcMediaPlayertvOS) built for tvOS Simulator
- NOTE  | [tvOS] xcodebuild:  ld: warning: building for tvOS Simulator, but linking in dylib file (/Users/tibbettsj/Developer/arc-video-sdk-ios/Build/Products/Debug-iphonesimulator/ArcMediaPlayeriOS.framework/ArcMediaPlayeriOS) built for iOS Simulator
Foo passed validation.

(我不确定为什么CocoaPods生成的App目标链接到错误的框架,但这看起来是一个不同的问题。(

pod repo push

$ bundle exec pod repo push private-repo Foo.podspec --private --allow-warnings --sources=private-repo,master
Validating spec
-> Foo (0.0.4)
- WARN  | url: The URL (https://github.com/private-repo/Foo) is not reachable.
- ERROR | file patterns: The `vendored_frameworks` pattern did not match any file.
- NOTE  | xcodebuild:  note: Using new build system
- NOTE  | xcodebuild:  note: Planning build
- NOTE  | xcodebuild:  note: Constructing build description
- NOTE  | xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')

vendored框架就是我所说的:

$ ls Build/Products/Debug-iphonesimulator/FooiOS.framework
ViewController.storyboardc/ Assets.car                  Info.plist                  _CodeSignature/
FooiOS*             Headers/                    Modules/
$ ls Build/Products/Debug-appletvsimulator/FootvOS.framework
ViewController.storyboardc/ Headers/                    Modules/
FootvOS*                Info.plist                  _CodeSignature/

使用pod spec lint而不是pod lib lint进行发布前测试。

只有pod spec lint会捕捉到的一个典型错误是忘记更新repo标记。

最新更新