今回の記事はXcodeのエラー「[!]Google-Mobile-Ads-SDK requires CocoaPods version >= 1.9.0,which is not satisfied by your current version, 1.8.4.」の原因とその解決方法に関しての記事です。困っている方は是非参考にしてみて下さい。
「[!]Google-Mobile-Ads-SDK requires CocoaPods version >= 1.9.0,which is not satisfied by your current version, 1.8.4.」原因
こちらの原因はCocoaPodのバージョンが「Google-Mobile-Ads-SDK」の必要なバージョンに達していないことが原因です。
「[!]Google-Mobile-Ads-SDK requires CocoaPods version >= 1.9.0,which is not satisfied by your current version, 1.8.4.」解決方法
CocoaPodのバージョンを上げれば問題ないということなのでCocoaPodのバージョンを上げることで解消されるはず。
下記のコードを試したのですが、うまくバージョンを上げることができませんでした。
sudo gem install -n /usr/local/bin cocoapods -v 1.9.3
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-1.15.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-1.15.4/gem_make.out
ここで記事を一つ見つけhomebrew経由でインストールするとアップデート可能という記事を発見しました。
そこで一度cocoapodをアンインストールし、homebrewでのインストールコマンドを実行。これはうまくいきそうだったのですが、またしても失敗。
をきき、インストール。
しかし、これも失敗。
メッセージを見ると下記のようになっていました。
私の作業フォルダ% brew install cocoapods
Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
Warning: cocoapods 1.11.2_1 is already installed, it's just not linked.
To link this version, run:
brew link cocoapods
どうやらすでに1.11というバージョンはインストールされているよう。リンクがおかしいとのことなので、ここを修正。
私の作業フォルダ% brew link cocoapods
Linking /usr/local/Cellar/cocoapods/1.11.2_1...
Error: Could not symlink bin/xcodeproj
Target /usr/local/bin/xcodeproj
already exists. You may want to remove it:
rm '/usr/local/bin/xcodeproj'
To force the link and overwrite all conflicting files:
brew link --overwrite cocoapods
To list all files that would be deleted:
brew link --overwrite --dry-run cocoapods
どうやらすでにXcodeのプロジェクトが存在してしまっているため、リンクがうまく貼れていなかったようです。
3つの選択肢はそれぞれ、Xcodeのプロジェクトを削除するか、上書きするか、最後はちょっとしらばえていません。私は二つ目の上書きを選択し、下記で無事バージョンを上げることに成功しました。
私の作業フォルダ% brew link --overwrite cocoapods
Linking /usr/local/Cellar/cocoapods/1.11.2_1... 2 symlinks created.
バージョンもしっかり上がっており、成功です。
これで「pod install」を行うことで無事「Google-Mobile-Ads-SDK」のライブラリを導入することができました。
今回の記事は以上です。他にも多数のXcode関連のエラー記事を記載しています。興味があればサイト内みていってください。
コメント