googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.21k stars 337 forks source link

[Bug] iOS Resolver Failed to install CocoaPods - macOS Monterey M1 Max #588

Closed Kharion closed 1 year ago

Kharion commented 1 year ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

iOS Resolver Failed to install CocoaPods for the current user: Do a fresh install of macOS Monterey or buy new M1 Max Macbook Pro. Install Xcode 14.2 Install Homebrew with Command Line Tools (14.2). Install Cocoapods via Homebrew for M1 architecture. Do fresh install of Unity 2021.3.15f1. Check the pod --version to confirm Cocoapods 1.11.3 are installed and working. Check the ruby version to confirm you have default ruby version installed. Open Unity project that contains External Dependency Manager The External Dependency Manager starts to complain that Ruby 2.6.0 is not on the PATH. Workaround: adding to the PATH in the .zshrc: export PATH="/Users/your_mac_user/.gem/ruby/2.6.0/bin:$PATH" The External Dependency Manager stops complaining about missing Ruby on the $PATH but still tries to install the Cocoapods. Cocoapods failing to install see error output below

Expected behaviour: Don't try to install the Cocoapods if the Cocoapods are already installed in the system.

Please answer the following, if applicable:

What's the issue repro rate? (eg 100%, 1/5 etc) 100%

What happened? How can we make the problem occur? gem install cocoapods --user-install Building native extensions. This could take a while... ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.

current directory: /Users/your_mac_user/.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 ./siteconf20230101-3435-12cdt0w.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:inblock 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:intry_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:inblock 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:inopen' 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:inopen' 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:inchecking_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:insystem_libffi_usable?' from extconf.rb:42:in `

'

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

/Users/your_mac_user/.gem/ruby/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-1.15.5/mkmf.log

extconf failed, exit code 1

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

If you have a downloadable sample project that reproduces the bug you're reporting, you will likely receive a faster response on your issue.

paulinon commented 1 year ago

Hi @Kharion,

I noticed that you also filed a similar ticket (#589) with additional information. Let's have the conversation there so that all discussion would be contained in one thread. That said, I'll be closing this ticket for now.

Kharion commented 1 year ago

Hi, yes I've created second ticket because I see this as two separate problems. The first is about trying auto install already installed Cocoapods and second is basically about unable to run pod install (for whatever reason) when the option is enabled.