简体   繁体   English

Firebase Android 资源生成错误 Firebase Unity SDK 由于 Python 2.7 在 macOS 12.3 Monterey 中被删除

[英]Firebase Android resource generation error in Firebase Unity SDK due to Python 2.7 being removed in macOS 12.3 Monterey

I am getting this error while opening unity with firebase sdk 8.7.0.使用 firebase sdk 8.7.0 打开 unity 时出现此错误。

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/Firebase/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?

System.ComponentModel.Win32Exception (0x80004005): ApplicationName='python', CommandLine='"/Users/xxx/Documents/unity-project/Assets/Firebase/Editor/generate_xml_from_google_services_json.py" -i "Assets/Firebase/GoogleService-Info.plist" -l --plist', CurrentDirectory='/Users/xxx/Documents/unity-project', Native error= mono-io-layer-error (2)
  at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in <0463b2ef957545c0a51b42f372cd4fbb>:0 
  at System.Diagnostics.Process.Start () [0x0003a] in <0463b2ef957545c0a51b42f372cd4fbb>: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) [0x002dc] in Z:\tmp\tmp.cvthQg1D2s\third_party\unity\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 Z:\tmp\tmp.cvthQg1D2s\third_party\unity\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.dYyxJerQE9\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.dYyxJerQE9\firebase\app\client\unity\editor\src\GenerateXmlFromGoogleServicesJson.cs:521 
 #0 GetStacktrace(int)
 #1 DebugStringToFile(DebugStringToFileData const&)
 #2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
 #3  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
 #4  (Mono JIT Code) [Z:\tmp\tmp.dYyxJerQE9\firebase\app\client\unity\editor\src\GenerateXmlFromGoogleServicesJson.cs:407] Firebase.Editor.GenerateXmlFromGoogleServicesJson:ReadBundleIds (string)

I tried running python /Users/xxx/Documents/unity-project/Assets/Firebase/Editor/generate_xml_from_google_services_json.py" -i "Assets/Firebase/GoogleService-Info.plist" -l --plist in shell and it successfully output my app's bundle id com.myapp.bundle我尝试在 shell 中运行 python /Users/xxx/Documents/unity-project/Assets/Firebase/Editor/generate_xml_from_google_services_json.py" -i "Assets/Firebase/GoogleService-Info.plist" -l --plist并成功运行 output 我的应用程序的包 ID com.myapp.bundle

I also tried reimporting firebase sdk, restart unity, restart mac, but none of them solves the issue.我也尝试重新导入 firebase sdk,重启 unity,重启 mac,但都没有解决问题。

I searched similar issues but unfortunately found no solution.我搜索了类似的问题,但遗憾的是没有找到解决方案。

What I did before this error showed up I upgraded macOS to the latest Monterey 12.3 I know it's because Python 2.7 was erased, but I don't know how to fix it.在出现此错误之前我做了什么 我将 macOS 升级到最新的 Monterey 12.3 我知道这是因为 Python 2.7 已被删除,但我不知道如何修复它。

I would appreciate some help.我会很感激一些帮助。 Getting pretty desperate, I've been on this all day long.变得非常绝望,我整天都在做这个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM