Swift CocoaPods could not find対処方法

pod installを実行して CocoaPods could not find compatible versions for pod “Firebase/Analytics”が出た場合の対処方法

Analyzing dependencies
Adding spec repo trunk with CDN https://cdn.cocoapods.org/
[!] CocoaPods could not find compatible versions for pod “Firebase/Analytics”:
  In snapshot (Podfile.lock):
    Firebase/Analytics (= 6.7.0)
 
  In Podfile:
    Firebase/Analytics
 
None of your spec sources contain a spec satisfying the dependencies: Firebase/Analytics, Firebase/Analytics (= 6.7.0).
 
You have either:
 * out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

リポジトリが「out-of-date」古いから更新しろと書いているので下記を実行する

pod repo update
pod install –repo-update

再度下記を実行する

pod deintegrate
pod install

【xcode CocoaPods エラー】 *.debug.xcconfig: unable to open

Xcodeでプロジェクトを開く

他人のXcodeプロジェクトを開く場合、下記のようなエラーが出ることがあります。

Showing Recent Messages
Build system information
error: /Users//Documents//.debug.xcconfig: unable to open file (in target “” in project ““) (in target ‘‘)

このようなエラーの場合、CocoaPodsが入っていません。

CocoaPods インストール

CocoaPodsは、GitHubなどのライブラリを自動管理してくれるツールです。
MacにRubyが入っているか確認します。

ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

CocoaPodsをインストールします。

sudo gem update –system
sudo gem install -n /usr/local/bin cocoapods
pod setup

プロジェクトファイルにインストールします。

Xcodeで開発したプロジェクトを展開し、pod インストールします。
プロジェクトファイルのディレクトリまで移動したあと、下記のコマンドを実行します。

pod deintegrate
pod install

Xcodeでプロジェクトファイルを開く場合は*. xcworkspace

プロジェクトファイルを開く場合は、*. xcodeprojではなく*. xcworkspaceを開く

2022 MJELD TECHNOLOGIES. ALL RIGHTS RESERVED