[FR] Unable to find command line tool python - extend binary checks
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2019.2.11f1
- Firebase Unity SDK version: 7.1.0
- Source you installed the SDK: This happened with both (.unitypackage and Unity Package Manager)
- Problematic Firebase Component: Auth, Database, Analytics
- Other Firebase Components in use: Auth, Database, Analytics
- Additional SDKs you are using: AdMob,GoogleMobileAds,Facebook, ...
- Platform you are using the Unity editor on: Ubuntu for CI builds
- Platform you are targeting: Android
- Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)
[REQUIRED] Please describe the issue here:
This seems related to #835
I tried with having python and python3 symlinked. Moved to the folders, the editor folders, etc. To no avail.
Steps to reproduce:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? What's the issue repro rate? (eg 100%, 1/5 etc)
What happened? How can we make the problem occur? This could be a description, log/console output, etc.
If you have a downloadable sample project that reproduces the bug you're reporting, you will likely receive a faster response on your issue.
Relevant Code:
We even have an extra build step, to add python to many folders, to no avail. I mean we just put python everywhere where the script may look, but we have no idea where it's actually looking.
which python
ls -lsah /usr/bin/python
sudo rm -rf /usr/bin/python
sudo ln -s $(which python) /usr/bin/python
sudo ln -s $(which python) $PWD/Assets/Firebase/Editor/python
sudo ln -s $(which python) $PWD/python
which python
python --version
Note: I was most likely doing that above step in the wrong environment.
Relevant Error Message:
Unable to find command line tool python required for Firebase Android resource generation.
python is required to generate the Firebase Android resource file google-services.xml from Assets/Resources/GoogleService-Info.plist. Without Firebase Android resources, your app will fail to initialize.
python was distributed with each Firebase Unity SDK plugin, was it deleted?
2021-03-25T07:31:11.4431920Z
System.ComponentModel.Win32Exception (0x80004005): ApplicationName='python', CommandLine='"/github/workspace/Library/PackageCache/[email protected]/Firebase/Editor/generate_xml_from_google_services_json.py" -i "Assets/Resources/GoogleService-Info.plist" -l --plist', CurrentDirectory='/github/workspace', Native error= Cannot find the specified file
at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in <fb35542c49c94f4d9bf912c73e79fe13>:0
at System.Diagnostics.Process.Start () [0x0003a] in <fb35542c49c94f4d9bf912c73e79fe13>:0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
at GooglePlayServices.CommandLine.RunViaShell (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] envVars, GooglePlayServices.CommandLine+IOHandler ioHandler, System.Boolean useShellExecution, System.Boolean stdoutRedirectionInShellMode) [0x002e8] in /Users/chkuang/Workspace/Git/unity-jar-resolver/source/AndroidResolver/src/CommandLine.cs:631
at GooglePlayServices.CommandLine.Run (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] envVars, GooglePlayServices.CommandLine+IOHandler ioHandler) [0x00000] in /Users/chkuang/Workspace/Git/unity-jar-resolver/source/AndroidResolver/src/CommandLine.cs:510
at Firebase.Editor.PythonExecutor.Run (System.Collections.Generic.IEnumerable`1[T] arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] envVars, GooglePlayServices.CommandLine+IOHandler ioHandler) [0x00000] in Z:\tmp\tmp.RemzflXQPx\firebase\app\client\unity\editor\src\PythonExecutor.cs:180
at Firebase.Editor.GenerateXmlFromGoogleServicesJson.RunResourceGenerator (System.Collections.Generic.IEnumerable`1[T] arguments, System.String inputPath, System.Boolean showCommandLine) [0x0001b] in Z:\tmp\tmp.RemzflXQPx\firebase\app\client\unity\editor\src\GenerateXmlFromGoogleServicesJson.cs:521
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:RunResourceGenerator(IEnumerable`1, String, Boolean) (at Z:\tmp\tmp.RemzflXQPx\firebase\app\client\unity\editor\src\GenerateXmlFromGoogleServicesJson.cs:525)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:ReadBundleIds(String) (at Z:\tmp\tmp.RemzflXQPx\firebase\app\client\unity\editor\src\GenerateXmlFromGoogleServicesJson.cs:407)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:UpdateConfigFileDirectory() (at Z:\tmp\tmp.RemzflXQPx\firebase\app\client\unity\editor\src\GenerateXmlFromGoogleServicesJson.cs:295)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Z:\tmp\tmp.RemzflXQPx\firebase\app\client\unity\editor\src\GenerateXmlFromGoogleServicesJson.cs:705)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:InvokeMethod(MethodInfo, Object[]) (at /home/builduser/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:662)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at /home/builduser/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:146)
(Filename: Z Line: 0)
Hmm, what happened if you run the following command:
python /github/workspace/Library/PackageCache/[email protected]/Firebase/Editor/generate_xml_from_google_services_json.py -i "/github/workspace/Assets/Resources/GoogleService-Info.plist" -l --plist
According to the code, it looks like as long as python is in your PATH(and source it), it should be fine.
I would recommend you to make sure python is in your PATH, and perhaps restart your machine so that your Unity instance can catch that change.
I would recommend you to make sure
pythonis in your PATH, and perhaps restart your machine so that your Unity instance can catch that change.
So this issue was due to me being confused about the proper environment. The builder environment was closed off itself, and only had python3 available ( not python ).
This is not an issue with the quickstart-unity I think, unless python should have been installed automatically if it's not found on the host system.
Hi @mastef,
Yes, that's correct. A Python installation is required on your machine ahead of time. Also I can confirm that the Firebase build scripts specifically look for the python binary executable, and not python3 as you've described. Also of note, we do recommend that python points to a python 3 binary.
I'm going to close this issue for now, but please feel free to reopen it if you have more questions. Thanks!
Yes, that's correct. A Python installation is required on your machine ahead of time. Also I can confirm that the Firebase build scripts specifically look for the
pythonbinary executable, and notpython3as you've described. Also of note, we do recommend thatpythonpoints to a python 3 binary.
I would recommend ( for the people coming after me ) to also look for a python3 binary if python is not present. As it doesn't seem to be a default that a python3 install also takes the python namespace.
Hi mstef,
Yes, we believe that we either use /usr/bin/env python or attempt to run python3 first, and fall back to python if it cannot be resolved. I'll add this as an internal issue for us to work on. Thanks.
Hi,
I had the same problem i just create a symbolic link to "python".
sudo ln -s /usr/bin/python3 /usr/bin/python
After this i restarted unity and the error was fix.
@DellaBitta on systems with python3 present ( but python not symlinked ), this error still appears.
Hi,
I had the same problem i just create a symbolic link to "python".
sudo ln -s /usr/bin/python3 /usr/bin/pythonAfter this i restarted unity and the error was fix.
I tried to run this command in my terminal but it says Operation not permitted(i have given my terminal full disk access).
I tried to run this command in my terminal but it says Operation not permitted(i have given my terminal full disk access).
What system are you running on? On a unix system you can run apt install python
Sorry my bad i should have included the details. I am using mac
Sorry my bad i should have included the details. I am using mac
so how did you deal with the problem?need your help
https://github.com/firebase/quickstart-unity/issues/1232#issuecomment-1068886444 i used their files and it worked for me
Sorry my bad i should have included the details. I am using mac
For mac simply install any python 2 version on your system. E.g. through homebrew like here https://docs.python-guide.org/starting/install/osx/