4

I recently tried to setup Google Firebase Analytics for my Unity game. I am building it for iOS exclusively. I have not been able to get Firebase working unfortunately.

I am using Xcode 8.1, OSX 10.12.1, and Unity 5.5.0f3

Whenever I try to build to iOS from Unity, I get this error in console:


Error running cocoapods. Please ensure you have at least version 1.0.0.  You can install cocoapods with the Ruby gem package manager:

sudo gem install -n /usr/local/bin cocoapods

pod setup

'pod --version' returned status: 127

output: 
UnityEngine.Debug:LogError(Object)
Google.IOSResolver:Log(String, Boolean, LogLevel)
Google.IOSResolver:OnPostProcessInstallPods(BuildTarget, String)
UnityEditor.HostView:OnGUI()

I have tried just about every suggestion I could find online. I have installed Cocoapods version 1.1.1, and later I tried the beta version 1.2.0.beta.1, nothing has worked.

Typing "which pod" in my terminal yields: /usr/local/bin/pod Typing "pod --version" in my terminal yields the correct version number (i.e.: 1.2.0.beta.1)

I cannot get this build to work in my game's project, or a completely empty project to which I just imported firebase and tried to build. I also tried to get this working with the sample project at the following link with no success: https://github.com/firebase/quickstart-unity

I am out of ideas here... can anyone help?

Much appreciated!

Gerald Lang
  • 41
  • 1
  • 3

2 Answers2

0

Firebase engineer here.

The code reporting the error is here: https://github.com/googlesamples/unity-jar-resolver/blob/b7a90e43d6c893622102ca53681f53a58dab1a24/source/IOSResolver/src/IOSResolver.cs#L760

unfortunately, it looks like we're not logging the stderr stream so it's tricky to see how this is failing.

It sounds like your pod tool is returning a non-zero error code, not sure why. For example, on my machine I see the following:

$ which pod
/usr/local/bin/pod
$ pod --version ; echo $?
1.1.1
0

As you can see "pod --version" is returning "0" (success).

Similarly, pulling the latest Cocoapods tool from github https://github.com/CocoaPods/CocoaPods yields:

cd CocoaPods
export RUBYLIB=$(cd lib ; pwd)
export COCOAPODS_NO_BUNDLER=1
$ ./bin/pod --version ; echo $?
1.2.0.beta.1
0

Where the same thing is happening, the pod tool is returning a success exit code.

Things to try:

Cheers, Stewart

Community
  • 1
  • 1
  • 1
    This is what I get when I run those commands: $ which pod /usr/local/bin/pod $ pod --version ; echo $? 1.2.0.beta.1 0 Any thoughts on what else could be wrong? This is my LANG variable: $ echo $LANG en_CA.UTF-8 What should I be changing the LANG variable to? I have already messaged firebase support at: https://firebase.google.com/support/contact/troubleshooting/?authuser=1 However, I have yet to receive a response. – Gerald Lang Dec 19 '16 at 19:55
  • 1
    Ah sorry the formatting in that comment is awful... Long story short, pod --version returns a zero error code, and my LANG is en_CA.UTF-8 and I am unsure what to change it to. – Gerald Lang Dec 19 '16 at 19:57
  • Seeing the same results myself and have same issue here – Chris Klingler Jan 10 '17 at 23:50
  • Did you ever figure out a solution? I gave up on Firebase because of this – knert Feb 06 '17 at 12:53
  • We added more debugging in the 1.1.2 release of the SDK, any chance you have any more useful log output? – stewartmiles Feb 08 '17 at 23:39
  • Using the latest Firebase SDK tonight. According to the Firebase website the SDK is 3.0? Below is the full output. Thanks! http://pastebin.com/7vuVHW0w EDIT: Could this be related to having two cocoapods installed? Typically for Xcode cocoapods is installed in a different location. Regardless, I installed it in the location the error wishes and still received the error. – knert Mar 11 '17 at 04:33
  • Stuck to same error from last two days? Any solution guys? – LebRon May 04 '17 at 10:57
  • @knert the error you're seeing looks similar to http://stackoverflow.com/questions/26247926/how-to-solve-usr-bin-env-ruby-executable-hooks-no-such-file-or-directory any chance you could give this a try? – stewartmiles May 05 '17 at 14:49
  • @LebRob any chance you have a log you could share? – stewartmiles May 05 '17 at 14:49
0

If you have this error in your output:

Failed to extract git version from `git --version` ("xcrun: error: active developer path (\"/Applications/Xcode.app/Contents/Developer\") does not exist\nUse `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.\nSee `man xcode-select` for more details.\n") (RuntimeError),

...and IF you have a different path to XCode (like in my case, I had Xcode beta), then you should run the command:

sudo xcode-select --switch /Applications/Xcode-beta.app/
joanis
  • 10,635
  • 14
  • 30
  • 40