質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

解決済

1回答

6464閲覧

Unity上でInstalling Cocoapodsでエラーが発生。

jobhiroshi

総合スコア1

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

0クリップ

投稿2022/11/02 07:54

GoogleAdmobバナー実装の為、Unity上でCocoapodsのインストールを
Assets>Externarl Dependency Manager > iOS Resolver > Installing Cocoapodsで試みますが、
以下のエラーメッセージが発生してしまいます。

実現したいこと

Installing Cocoapodsを選択時に出るエラーを解決したい。

発生している問題・エラーメッセージ

**エラーメッセージ↓ ※”xxxxxxxxx” はユーザーネームです。

Failed to install CocoaPods for the current user.

It will not be possible to install Cocoapods in the generated Xcode project which will result in link errors when building your application.

For more information see:
https://guides.cocoapods.org/using/getting-started.html

'gem install cocoapods --user-install' failed with code (1):
Building native extensions. This could take a while...

WARNING: You don't have /Users/xxxxxxxxx/.gem/ruby/2.6.0/bin in your PATH,
gem executables will not run.
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.

current directory: /Users/xxxxxxxxx/.gem/ruby/2.6.0/gems/ffi-1.15.5/ext/ffi_c

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20221102-6562-73c1p8.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--enable-system-libffi
--disable-system-libffi
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header' from extconf.rb:10:in `system_libffi_usable?' from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/Users/xxxxxxxxx/.gem/ruby/2.6.0/extensions/universal-darwin-22/2.6.0/ffi-1.15.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/xxxxxxxxx/.gem/ruby/2.6.0/gems/ffi-1.15.5 for inspection.
Results logged to /Users/xxxxxxxxx/.gem/ruby/2.6.0/extensions/universal-darwin-22/2.6.0/ffi-1.15.5/gem_make.out

UnityEngine.Debug:LogError (object)
Google.Logger:Log (string,Google.LogLevel) (at Z:/tmp/tmp.bz34rNo3Jl/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/Logger.cs:136)
Google.IOSResolver:Log (string,bool,Google.LogLevel) (at Z:/tmp/tmp.I3jLaFZ1qe/third_party/unity/unity_jar_resolver/source/IOSResolver/src/IOSResolver.cs:1213)
Google.IOSResolver:LogToDialog (string,bool,Google.LogLevel) (at Z:/tmp/tmp.I3jLaFZ1qe/third_party/unity/unity_jar_resolver/source/IOSResolver/src/IOSResolver.cs:1224)
Google.IOSResolver/<InstallCocoapods>c__AnonStorey2:<>m__0 (int,Google.IOSResolver/CommandItem[],GooglePlayServices.CommandLine/Result,GooglePlayServices.CommandLineDialog) (at Z:/tmp/tmp.I3jLaFZ1qe/third_party/unity/unity_jar_resolver/source/IOSResolver/src/IOSResolver.cs:1780)
Google.IOSResolver/<RunCommandsAsync>c__AnonStorey4:<>m__0 (GooglePlayServices.CommandLine/Result) (at Z:/tmp/tmp.I3jLaFZ1qe/third_party/unity/unity_jar_resolver/source/IOSResolver/src/IOSResolver.cs:2451)
GooglePlayServices.CommandLineDialog/ProgressReporter:SignalComplete () (at Z:/tmp/tmp.8Yc6AQywfq/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/CommandLineDialog.cs:116)
GooglePlayServices.CommandLineDialog/ProgressReporter:CommandLineToolCompletion (GooglePlayServices.CommandLine/Result) (at Z:/tmp/tmp.8Yc6AQywfq/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/CommandLineDialog.cs:107)
GooglePlayServices.CommandLine/<RunAsync>c__AnonStorey0/<RunAsync>c__AnonStorey1:<>m__0 () (at Z:/tmp/tmp.8Yc6AQywfq/third_party/unity/unity_jar_resolver/source/AndroidResolver/src/CommandLine.cs:137)
Google.RunOnMainThread:ExecuteNext () (at Z:/tmp/tmp.bz34rNo3Jl/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:486)
Google.RunOnMainThread:<ExecuteAllUnnested>m__1 () (at Z:/tmp/tmp.bz34rNo3Jl/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:536)
Google.RunOnMainThread:RunAction (System.Action) (at Z:/tmp/tmp.bz34rNo3Jl/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested (bool) (at Z:/tmp/tmp.bz34rNo3Jl/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:ExecuteAll () (at Z:/tmp/tmp.bz34rNo3Jl/third_party/unity/unity_jar_resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:356)

試したこと

Unity内はBuildでiOSにPlatformをSwitchして、
Google Admobの広告スクリプトをGame Objectに貼り付けている状態です。

Terminal上でCocoapods/Homebrew/Xcode/rbenvのInstall
以下の状態です。(他に必要な情報がございましたらお手数ですがお申し付け下さい。)


xxxxxxxxxxx@Mac-mini ~ % pod --version
1.11.3
xxxxxxxxxxx@Mac-mini ~ % which pod
/Users/xxxxxxxxxxx/.rbenv/shims/pod
xxxxxxxxx@Mac-mini ~ % sudo gem install cocoapods
Password:
Successfully installed cocoapods-1.11.3
Parsing documentation for cocoapods-1.11.3
Done installing documentation for cocoapods after 0 seconds
1 gem installed
xxxxxxxxx@Mac-mini ~ % brew --version
Homebrew 3.6.8
Homebrew/homebrew-core
(git revision edbc4965f09; last commit 2022-11-02)
xxxxxxxxx@Mac-mini ~ % rbenv --version
rbenv 1.2.0

XCODEのバージョンは14.0.1です。
初心者ながら色々調べて、M1のApple Siliconであることやffiの問題など
色々障壁が存在するようですが、根本的に何が問題なのかがわかっていない状況です。
情報が不十分であれば追記いたしますのでどうか助けてください。

補足情報(FW/ツールのバージョンなど)

Mac mini(2020 M1)
Mac OS Ventura 13.0
Unity Editor Version:2021.3.5f1

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Hi,

At the beginning I try this Installation Tutorial to install Ruby, but compilation error occurs at the end of the installation.
https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#start-here-if-you-choose-the-long-and-manual-route

So I try this "SUDO" command: sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
, then It work for me.
https://developer.apple.com/forums/thread/668456

Hope it can help

投稿2022/11/08 08:59

Syaoran

総合スコア9

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jobhiroshi

2022/11/08 10:50

Thank you so much!! Really helpful for me.
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問