简体   繁体   中英

Cocoapods: pod lint works, but pod repo push fails to validate because of missing versioned_frameworks

I have an iOS & tvOS framework that I'm trying to publish as a private, binary-only CocoaPod. The Podspec lint s without errors, but pushing it to the repo fails validation. Is the validation step different when pushing vs. when linting?

Foo.podspec

Only the relevant parts:

  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'

Note that I changed the workspace's build output directory to be local to the project root , not the default ~/Library/Developer/Xcode/Derived Data folder.

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.

(I'm not sure why the CocoaPods-generated App targets are linked to the wrong frameworks, but that looks like a different problem.)

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')

The vendored frameworks are where I say they are:

$ 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/

Use pod spec lint instead of pod lib lint to do pre-publishing testing.

A typical error that only pod spec lint will catch is forgetting to update the repo tag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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