LoginSignup
5

More than 5 years have passed since last update.

Xcode8 + Swift3 + CocoaPods で pod trunk push が失敗する場合の対処法

Last updated at Posted at 2016-09-27

概要

CocoaPodsに新しいバージョンを更新しようとしたらいくつかハマったので共有します。

ケース1

状況

Swift3対応したライブラリをアップしようとしたら、大量のエラーが発生。
--verbose で見るとどうやら Swift2.3でコンパイルされている。

解決策

プロジェクトフォルダ直下で下記コマンドを実行後、再度アップすることで解決。

$ echo 3.0 > .swift-version

ケース2

状況

次のようにバージョンアップ作業をしていたら

$ pod trunk push ライブラリ名.podspec

下記エラーが発生しました。

ERROR | [iOS] unknown: Encountered an unknown error (Simulator iPhone 4s is not available.) during validation.

エラーを検索すると、いくつかヒットします。

Can't do pod trunk push for a Swift 3.0 library #5515
https://github.com/CocoaPods/CocoaPods/issues/5515

[Xcode 8 beta] pod spec lint: "iPhone 4s is not available" #5519
https://github.com/CocoaPods/CocoaPods/issues/5519

Fix linting with Xcode 8 #5529
https://github.com/CocoaPods/CocoaPods/pull/5529

最後のURLを見る限り、どうやら解決済みのようです。

GitHubに飛ぶと
https://github.com/CocoaPods/CocoaPods/releases
修正済みバージョンが上がってます。

解決策

Homebrewの人は

$ brew info cocoapods

を叩くと確認できると思いますが。

実は修正済みバージョンはまだ、安定版ではなく開発版です。

cocoapods: stable 1.0.1 (bottled), devel 1.1.0.rc.2

開発版をアップグレードする場合

$ brew upgrade --devel cocoapods

で、開発版がインストールされます。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5