Unity Firebase plugin Fails as (Error loading Python DLL: error code 14001)

Question:

I would like to use Firebase Analytics for my ANDROID game building in Unity. However, when I follow the document and instructions, during the google-services.json to google-services.xml operation, it fails and says:

Generation of the Firebase Android resource file google-services.xml from Assets/google-services.json failed.
If you have not included a valid Firebase Android resources in your app it will fail to initialize.
`E:/UnityProjects/Seven/Assets..Assets/Firebase/Editor/generate_xml_from_google_services_json.exe -i "Assets/google-services.json" -l`.

Error loading Python DLL: C:UsersftbAppDataLocalTemp_MEI59722python27.dll (error code 14001)

Therefore, it never extracts my package name an initialize, then it crashes.

The Environment

OS: Windows 7

Unity Version: 2019.2.16f1 (Android Build Support and IOS Build Support)

Visul Studio installs:

enter image description here

Firebase SDK: Firebase Unity SDK 6.8.0 (dotnet4)

The package: FirebaseAnalytics.unitypackage

What I tried

1- I suspected and checked google-services.json. The file is correct (downloaded from firebase dashboard)

2- I have installed dotnet3 firebase sdk package, and failed.

3- I triggered the generate_xml_from_google_services_json.exe file by cmd, then got the same result as unity (Error loading Python DLL: C:UsersftbAppDataLocalTemp_MEI59722python27.dll (error code 14001))

4- I triggered generate_xml_from_google_services_json.exe without any parameter (without this:-i "C:gsoogle-services.json" -l), then it exactly responses the same result, "Error loading Python DLL"

5- I moved all the "Editor" folder that comes by Firebase SDK to another machine (Windows Server 2016) and triggered google_services_json.exe by cmd, then it extracted my package name successfully with no error

6- Installed several Redistributable Package provided by Windows, tried and failed.

7- Installed Visual Studio Build Tools, Visual Studio Community 2017, C++ and Desktop builtools, tried and failed.

8- Windows 7 is up to date. Installed all updates

9- Installed python27, python36

10- Copied python27.dll to System, System32 and SysWOW64 windows folders. It still fails.

According to the above list, I think the problem is about the environment settings or Operating System of my computer. All the problem is executing the generate_xml_from_google_services_json.exe file. All it does is to convert google-services.json to google-services.xml

Is it impossible to use Firebase Unity SDK on Windows 7? Is there any way to solve this?

UPDATE

I tried Firebase Unity 10.2.0, results are same. There is no support for Windows 7 any more?

Asked By: anL

||

Answers:

This seems like a bug possibly related to Windows 7, judging from this other Stack Overflow question.

In short, Firebase does rely on Python for part of its preprocessing pipeline (as you’ve probably inferred). On MacOS and Linux, it’s assumed that python is installed and maintained by your operating system (and that’s probably a pretty safe assumption). On Windows, although a Windows developer running Visual Studio might have Python installed, it’s far from a guarantee (and if it was installed, it’s not guaranteed to be in $PATH &c).

The best workaround for the majority of Firebase users is to build and deploy a Python environment for running this tool. It looks like this process generated a file that can run on more recent versions of Windows but not necessarily Windows 7. You may be able to work around this immediately by installing a newer Windows CRT (for example, this one might work), but that’s far from an ideal experience.

It looks like the best solution might be as simple as getting the firebase team to build with --win-private-assemblies, but it may be more involved as well. For that reason, I’d ask that you either file a ticket on Firebase Support directly or file an issue on the Firebase Unity GitHub repo so others who come across this post can follow the process.

I hope this helps!

–Patrick

Answered By: Patrick Martin

It is solved by downgrading the Unity SDK to 6.7.0. It works without any errors.

It is not a “solution” so I will not sign this as “accepted answer”. I have no idea why it is happening for 6.8.0. Check @Pux0r3’s answer.

If it works when I downgrade to 6.7.0, It means it is not directly cause of the environment. So it is a bug. Check the release note of 6.8.0:

Fixed an issue where resource generation from google-services.json
would fail if python3 was used to execute the resource generation
script.

Btw, At December 16, 2019, Version 6.8.1 is released. I didn’t try it yet.

UPDATE

I tested version 6.9.0. The result is same.

Answered By: anL

in my case while installing python you have to click "path" checkbox and restart computer problem solved for me .enter image description here

Answered By: Furkan Kalli

This issue has been solved at Firebase Unity 10.3.0 plugin (December 14, 2022)

I have tried almost all new versions of Firebase Unity from the date Dec 16, 2019 to December 14, 2022. It finally resolved after 3 years.

Answered By: anL