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

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

コメントを投稿

0 コメント