Skip to content

[Bug] iOS Resolver: Failed to install CocoaPods for the current user #654

Open
@derwaldgeist

Description

@derwaldgeist
  • Unity editor version: 2022.3.13f1 Silicon
  • External Dependency Manager version: 1.2.176
  • Source you installed EDM4U: From a Unity package
  • Features in External Dependency Manager in use: Android and iOS Resolver
  • Plugins SDK in use: Facebook, Google Sign In
  • Platform you are using the Unity editor on: MacOS Sonoma, Apple Silicon

I just got my M3 MacBook Pro and am trying to get my existing Unity project up and running. After installing the Silicon version of Unity Editor, I opened my project for the first time. This resulted in an error message that Cocoapods cannot be installed

image image

I have upgraded my cocapods (1.14.2) and Ruby (3.2.2) installations, but still the problem persists. It seems as if EDM4U picks up an installation that was already pre-installed on the machine.

What's the issue repro rate? 100%

What happened? How can we make the problem occur?

Just install Unity on a fresh Apple Silicon MacBook and try to open an existing project using EDM4U.

Activity

google-oss-bot

google-oss-bot commented on Nov 14, 2023

@google-oss-bot

This issue does not seem to follow the issue template. Make sure you provide all the required information.

derwaldgeist

derwaldgeist commented on Nov 14, 2023

@derwaldgeist
Author

I also found this Issue:

#589

which has been closed but without a real solution. I tried to set the UTF8 setting mentioned in the comments, but this did not work.

Plus, I tried to install cocoapods 1.10.2 as recommended in the comments as well, but this does not seem to be available for Silicon Macs, neither via sudo gem install nor via homebrew.

paulinon

paulinon commented on Nov 14, 2023

@paulinon
Collaborator

Hi @derwaldgeist,

Have you installed Xcode and Xcode Command Line Tools? You'll need Xcode in order to build your app on an iOS device since Unity only generates the Xcode project. You can install Xcode Command Line Tools using this command:

xcode-select --install

I look forward to hearing from you soon.

remzisenel

remzisenel commented on Nov 14, 2023

@remzisenel

I am in the same boat as the original poster.

$ xcode-select --install

xcode-select: note: Command line tools are already installed. Use "Software Update" in System Settings or the softwareupdate command line interface to install updates

osx Sonoma ships with ruby 2.6.10.210 and iOS Resolver uses the system shipped ruby version even when a newer ruby version is installed and configured in shell profile.

$ ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.4.10
  - RUBY VERSION: 3.2.2 (2023-03-30 patchlevel 53) [arm64-darwin23]
...
remzisenel

remzisenel commented on Nov 14, 2023

@remzisenel

I confirmed my shell profile is loading correctly into Unity process by executing ruby --version and gem env through a process created within Unity runtime. I'm also using bash to make sure the shell is the same as the one being used by the iOS Resolver.

var process = new Process();
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = "bash";
...
process.Start();

Outputs:

'ruby --version' completed with code 0

ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]
'gem env' completed with code 0

RubyGems Environment:
  - RUBYGEMS VERSION: 3.4.10
  - RUBY VERSION: 3.2.2 (2023-03-30 patchlevel 53) [arm64-darwin23]
...
'echo $PATH' completed with code 0

[HOME_DIR]/.rbenv/shims:...

.rbenv/shims have symlinks to the ruby-3.2.2 environment

derwaldgeist

derwaldgeist commented on Nov 14, 2023

@derwaldgeist
Author

xcode-select --install

Yes, Xcode command line tools are already installed. But still, I cannot make it work. This did not happen on my Intel Mac, with the very same setup. Could it be that it is a Silicon Mac specific problem?

added and removed
needs-infoNeed information for the developer
on Nov 14, 2023
derwaldgeist

derwaldgeist commented on Nov 14, 2023

@derwaldgeist
Author

@remzisenel I guess you didn't find a solution yet, did you? This is driving me nuts... I get the same output from ruby -v and gem env as you, if I call them on the terminal. I'm using zsh, though, with the oh-my-zsh addon. This worked fine on my Intel Mac.

derwaldgeist

derwaldgeist commented on Nov 14, 2023

@derwaldgeist
Author

I've also checked my path now. It contains /opt/homebrew/opt/ruby/bin which correctly points to a ruby 3.2.2 executable, as well as a gem 3.4.22 executable.

The error dialog I am getting claims that it only finds ruby 2.6.10.210 instead. Wherever this version comes from. This is installed in /usr/bin. If I get these instructions right, this version shall not be removed because it is required by MacOS itself:

https://mac.install.guide/ruby/9.html

derwaldgeist

derwaldgeist commented on Nov 14, 2023

@derwaldgeist
Author

I tried to tell asdf to use ruby 3.2.2 inside the Unity project, but this did not help. Also tried to set Use Shell to Execute Cocoapod Tool in EDM4U to false, but this didn't have an effect either. Is there another way to tell EDM4U where to locate the right ruby version?

I've also checked bash and sh. All point to the 3.2.2 version.

22 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @fuzzybinary@remzisenel@derwaldgeist@hantengx@juni1423

        Issue actions

          [Bug] iOS Resolver: Failed to install CocoaPods for the current user · Issue #654 · googlesamples/unity-jar-resolver